Skip to content

Commit a3490e2

Browse files
committed
remove airlock registry for python
1 parent 34835a5 commit a3490e2

4 files changed

Lines changed: 7 additions & 54 deletions

File tree

.cloudbuild/library_generation/image-configuration/airlock-pip.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

.cloudbuild/library_generation/image-configuration/airlock-pypirc

Lines changed: 0 additions & 11 deletions
This file was deleted.

.cloudbuild/library_generation/library_generation.Dockerfile

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,12 @@ RUN --mount=type=cache,target=/root/.m2 cp "/root/.m2/repository/com/google/api/
5454
# python:3.11-alpine
5555
FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/python@sha256:0b5ed25d3cc27cd35c7b0352bac8ef2ebc8dd3da72a0c03caaf4eb15d9ec827a as python-scripts-build
5656

57-
# This will use GOOGLE_APPLICATION_CREDENTIALS if passed in docker build command.
58-
# If not passed will leave it unset to support GCE Metadata in CI builds
59-
ARG GOOGLE_APPLICATION_CREDENTIALS
60-
61-
RUN apk add bash curl
62-
63-
# Install gcloud to obtain the credentials to use the Airlock repostiory
64-
RUN curl -sSL https://sdk.cloud.google.com | bash -e
65-
ENV PATH $PATH:/root/google-cloud-sdk/bin
66-
67-
68-
# Configure the Airlock pip package repository
69-
RUN pip install keyrings.google-artifactregistry-auth -i https://pypi.org/simple/
70-
COPY .cloudbuild/library_generation/image-configuration/airlock-pypirc /root/.pypirc
71-
COPY .cloudbuild/library_generation/image-configuration/airlock-pip.conf /etc/pip.conf
72-
RUN chmod 600 /root/.pypirc /etc/pip.conf
73-
7457
COPY library_generation /src
7558

7659
# install main scripts as a python package
7760
WORKDIR /src
7861

79-
RUN --mount=type=secret,id=credentials python -m pip install --target /usr/local/lib/python3.11 -r requirements.txt
62+
RUN python -m pip install --target /usr/local/lib/python3.11 -r requirements.txt
8063
RUN python -m pip install --target /usr/local/lib/python3.11 .
8164

8265
# Final image. Installs the rest of the dependencies and gets the binaries
@@ -155,18 +138,18 @@ RUN rm /utilities.sh
155138
RUN chmod 777 "${HOME}"
156139
RUN touch "${HOME}/.bashrc" && chmod 755 "${HOME}/.bashrc"
157140

141+
# Copy the owlbot-cli binary
142+
COPY --from=owlbot-cli-build /tools/repo-automation-bots/packages/owl-bot "/owl-bot"
143+
WORKDIR /owl-bot
144+
RUN npm link
145+
158146
# Here we transfer gapic-generator-java from the previous stage.
159147
# Note that the destination is a well-known location that will be assumed at runtime.
160148
# We hard-code the location string so it cannot be overriden.
161149
COPY --from=ggj-build "/gapic-generator-java.jar" "${HOME}/.library_generation/gapic-generator-java.jar"
162150
RUN chmod 755 "${HOME}/.library_generation"
163151
RUN chmod 555 "${HOME}/.library_generation/gapic-generator-java.jar"
164152

165-
# Copy the owlbot-cli binary
166-
COPY --from=owlbot-cli-build /tools/repo-automation-bots/packages/owl-bot "/owl-bot"
167-
WORKDIR /owl-bot
168-
RUN npm link
169-
170153
# Copy the library_generation python packages
171154
COPY --from=python-scripts-build "/usr/local/lib/python3.11/" "/usr/lib/python3.11/"
172155

library_generation/DEVELOPMENT.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,9 @@ This is convenient in order to avoid installing the dependencies manually.
129129
> From now, the examples assume you are in the root of your sdk-platform-java
130130
> folder.
131131
132-
## Prepare your gcloud Application-Default-Credentials
133-
This is necessary for the build context to access the Airlock repository of
134-
Python packages.
135-
To configure your credentials:
136-
137-
```bash
138-
# creates or updates the credentials file in ~/.config/gcloud
139-
gcloud auth application-default login
140-
```
141-
142132
## Build the docker image
143133
```bash
144-
DOCKER_BUILDKIT=1 docker build \
145-
--file .cloudbuild/library_generation/library_generation.Dockerfile \
146-
--secret="id=credentials,src=$HOME/.config/gcloud/application_default_credentials.json" \
147-
--build-arg GOOGLE_APPLICATION_CREDENTIALS=/run/secrets/credentials \
148-
--iidfile image-id .
134+
docker build --file .cloudbuild/library_generation/library_generation.Dockerfile --iidfile image-id .
149135
```
150136

151137
This will create an `image-id` file at the root of the repo with the hash ID of

0 commit comments

Comments
 (0)