From d629783271420e1d63c69730b5792d81a83756cb Mon Sep 17 00:00:00 2001 From: Rishab Prasad Date: Tue, 4 Oct 2022 17:10:20 +0530 Subject: [PATCH] Publish Images For Operate-First --- .github/workflows/publish-images.yaml | 30 +++++++++++++++++++++++++++ Dockerfile | 27 ++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/publish-images.yaml create mode 100644 Dockerfile diff --git a/.github/workflows/publish-images.yaml b/.github/workflows/publish-images.yaml new file mode 100644 index 0000000..080974f --- /dev/null +++ b/.github/workflows/publish-images.yaml @@ -0,0 +1,30 @@ +name: Publish Images to Quay.io +on: + workflow_dispatch: {} + push: + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'README*' + - 'scripts/**' + - 'manifests/**' + - 'design/**' + branches: [ main ] + +jobs: + publish-images-to-quay: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Login to Quay.io Registry + run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io + + - name: Build Image + run: docker build -t quay.io/kruize/hpo:operate-first . + + - name: Publish Image to quay + run: docker push quay.io/kruize/hpo:operate-first + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b78072c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM registry.fedoraproject.org/f33/python3 + +LABEL name="Kruize HPO" \ + vendor="Red Hat" \ + run="docker run --rm -it -p 8085:8085 " \ + summary="Docker Image for HPO" \ + description="For more information on this image please see https://github.com/kruize/hpo/blob/main/README.md" + +USER 0 + +# Copy ML hyperparameter tuning code and other required files +COPY src ./src/ +COPY requirements.txt index.html experiment.html ./ + +# Documented here: +# https://docs.openshift.com/container-platform/4.6/openshift_images/create-images.html#images-create-guide-openshift_create-images +RUN chown -R 1001:0 ./ +USER 1001 + +# Install the dependencies and required python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --requirement requirements.txt + +EXPOSE 8085 50051 + +# Run the application +CMD python3 -u src/service.py \ No newline at end of file