Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cloudbuild script to allow for regular image re-builds #91

Merged
merged 9 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,35 @@
FROM golang
SHELL ["/bin/bash", "-c"]

#RUN git clone https://github.com/mbj4668/pyang.git /workspace/results/pyang@head/pyang
RUN git clone https://github.com/openconfig/oc-pyang /workspace/oc-pyang-repo
RUN git clone https://github.com/robshakir/pyangbind /workspace/pyangbind-repo

RUN apt-get update
RUN apt install -y python3-pip
RUN pip3 install virtualenv
RUN apt install -y virtualenv
# Not using virtualenv since some validators (e.g. pyang) already uses
# virtualenv, and we can't nest virtualenvs.
# TODO(wenovus): Move these into a requirement file for each validator so
# installing python packages here is not necessary.
#RUN virtualenv /workspace/pyangvenv

# Install packages for latest pyang venv.
RUN pip3 install wheel && \
pip3 install pyaml && \
pip3 install enum34 && \
pip3 install jinja2 && \
pip3 install setuptools && \
pip3 install --no-cache-dir -r /workspace/oc-pyang-repo/requirements.txt && \
pip3 install --no-cache-dir -r /workspace/pyangbind-repo/requirements.txt
# pip3 install pyangbind
RUN apt install python3-wheel && \
pip3 install pyaml enum34 --break-system-packages && \
apt install -y python3-jinja2 && \
apt install -y python3-setuptools && \
dplore marked this conversation as resolved.
Show resolved Hide resolved
pip3 install --no-cache-dir --break-system-packages -r /workspace/oc-pyang-repo/requirements.txt && \
pip3 install --no-cache-dir --break-system-packages -r /workspace/pyangbind-repo/requirements.txt

RUN apt install -y npm && npm install -g npm && npm install -g badge-maker
RUN apt install -y npm
#RUN npm install -g npm
RUN npm install -g badge-maker

# Downloading gcloud package
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz

ENV CLOUDSDK_PYTHON /usr/bin/python3

# Installing the package
RUN mkdir -p /usr/local/gcloud \
&& tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \
Expand Down
7 changes: 7 additions & 0 deletions cloudbuild/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'us-west1-docker.pkg.dev/$PROJECT_ID/models-ci/models-ci-image', '-f', 'Dockerfile', '.' ]
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'us-west1-docker.pkg.dev/$PROJECT_ID/models-ci/models-ci-image']
images:
- us-west1-docker.pkg.dev/$PROJECT_ID/models-ci/models-ci-image
Loading