Skip to content

Commit

Permalink
Publish Dockerfile in docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
lecriste authored Dec 10, 2024
1 parent f0c38ee commit ccf1f43
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 22 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/on_tag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish sdist tarball to PyPi
name: Publish sdist tarball to PyPi and docker image to docker hub

on:
push:
Expand All @@ -15,7 +15,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build a source tarball
- name: Install build
run: |
python -m pip install --upgrade pip
python -m pip install build
Expand All @@ -27,3 +27,26 @@ jobs:
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true

deploy_docker_image:
env:
CI_REGISTRY_IMAGE: bluebrain/bbp-atlas-pipeline
REGISTRY_IMAGE_TAG: ${{ github.ref_name }}
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Docker Hub Login
uses: docker/login-action@v3
with:
username: ${{ vars.BBPBUILDBOT_DOCKERHUB_USER }}
password: ${{ secrets.BBPBUILDBOT_DOCKERHUB_PASSWORD }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ env.CI_REGISTRY_IMAGE }}:${{ env.REGISTRY_IMAGE_TAG }}
build-args: |
REF_NAME=${{ env.REGISTRY_IMAGE_TAG }}
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ update-pipeline-image:
allow_failure: true
variables:
BUILD_PATH: $CI_PROJECT_DIR
KANIKO_EXTRA_ARGS: "--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg BBP_CA_CERT='$BBP_CA_CERT'"
KANIKO_EXTRA_ARGS: "--build-arg REF_NAME=$REGISTRY_IMAGE_TAG"
KUBERNETES_MEMORY_LIMIT: 4Gi
KUBERNETES_MEMORY_REQUEST: 4Gi
before_script:
Expand Down
30 changes: 11 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM python:3.10-slim

ARG CI_JOB_TOKEN
ARG BBP_CA_CERT
ARG REF_NAME=main # Default to 'main' if REF_NAME is not passed

RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" TZ="Europe/Zurich" apt-get install -y tzdata && \
Expand All @@ -27,39 +26,32 @@ COPY .. .
# export PATH=$PATH:$PWD/build/bin

# Install the pipeline repository (along with the bbp-atlas CLI)
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ blue_brain_atlas_pipeline/
RUN pip install git+https://github.com/BlueBrain/bbp-atlas-pipeline.git@${REF_NAME}

# For install dependencies
RUN git config --global --add url."https://gitlab-ci-token:${CI_JOB_TOKEN}@bbpgitlab.epfl.ch/".insteadOf https://bbpgitlab.epfl.ch/
# Install dependencies

# module load py-token-fetch
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "blue-brain-token-fetch>=1.0.0"
RUN pip install "blue-brain-token-fetch>=1.0.0"

# module load py-bba-datafetch
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "bba-data-fetch>=0.3.0"
RUN pip install git+https://github.com/BlueBrain/bbp-atlas-data-fetch.git@v0.3.0

# densities validation
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "densities-validation>=0.1.1"
RUN pip install git+https://github.com/BlueBrain/[email protected]

# leaves-only
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "cell-densities>=0.2.1"
RUN git clone --branch v0.2.1 https://github.com/BlueBrain/cell-density-validations.git cell-density-validation
RUN pip install cell-density-validation/cell-densities/

# module load py-bba-webexporter
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "blue-brain-atlas-web-exporter>=3.0.0"

# module load py-data-integrity-check
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "bba-data-integrity-check>=0.2.0"
RUN pip install git+https://github.com/BlueBrain/[email protected]

RUN pip install blue-cwl

# module load py-bba-data-push
RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "bba-data-push>=4.3.0"

RUN pip install git+https://bbpgitlab.epfl.ch/dke/users/jonathanlurie/[email protected]

RUN pip install -i https://bbpteam.epfl.ch/repository/devpi/simple/ "pipeline-validator>=0.3.1"
RUN pip install "blue-brain-data-push>=4.3.0"

RUN git config --global --remove-section url."https://gitlab-ci-token:${CI_JOB_TOKEN}@bbpgitlab.epfl.ch/"
RUN pip install "bbp-atlas-pipeline-validator>=0.3.1"

RUN pip install "atlas-commons>=0.1.5"

Expand Down

0 comments on commit ccf1f43

Please sign in to comment.