From 6f7ead7d0f51cc265565f61584fb36bdf895e9e0 Mon Sep 17 00:00:00 2001 From: Marcel R Date: Sun, 5 Nov 2023 10:51:04 +0100 Subject: [PATCH] Add a9 py38-11 images. --- .github/workflows/deploy_images_a9.yml | 122 ++++++++++++++++++++++++- .github/workflows/deploy_images_c7.yml | 44 ++++----- .github/workflows/deploy_images_c8.yml | 60 ++++++------ docker/Dockerfile_alma9_py310 | 82 +++++++++++++++++ docker/Dockerfile_alma9_py311 | 82 +++++++++++++++++ docker/Dockerfile_alma9_py37 | 2 +- docker/Dockerfile_alma9_py38 | 82 +++++++++++++++++ docker/Dockerfile_alma9_py39 | 82 +++++++++++++++++ 8 files changed, 502 insertions(+), 54 deletions(-) create mode 100644 docker/Dockerfile_alma9_py310 create mode 100644 docker/Dockerfile_alma9_py311 create mode 100644 docker/Dockerfile_alma9_py38 create mode 100644 docker/Dockerfile_alma9_py39 diff --git a/.github/workflows/deploy_images_a9.yml b/.github/workflows/deploy_images_a9.yml index ab443b68..4bdd57ad 100644 --- a/.github/workflows/deploy_images_a9.yml +++ b/.github/workflows/deploy_images_a9.yml @@ -8,7 +8,7 @@ on: required: false default: 'false' specific_job: - description: Run a specific job? (a9-py37) + description: Run a specific job? (a9-py37|a9-py38|a9-py39|a9-py310|a9-py311) required: false default: '' @@ -42,3 +42,123 @@ jobs: platforms: linux/amd64,linux/arm64 push: ${{ github.event.inputs.build_only != 'true' }} tags: riga/law:a9-py37 + + a9-py38: + if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'a9-py38') }} + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up QEMU 🌈 + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx ✨ + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub 🎪 + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and deploy image 🐳 + uses: docker/build-push-action@v5 + with: + context: docker + file: docker/Dockerfile_alma9_py38 + platforms: linux/amd64,linux/arm64 + push: ${{ github.event.inputs.build_only != 'true' }} + tags: riga/law:a9-py38 + + a9-py39: + if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'a9-py39') }} + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up QEMU 🌈 + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx ✨ + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub 🎪 + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and deploy image 🐳 + uses: docker/build-push-action@v5 + with: + context: docker + file: docker/Dockerfile_alma9_py39 + platforms: linux/amd64,linux/arm64 + push: ${{ github.event.inputs.build_only != 'true' }} + tags: riga/law:a9-py39 + + a9-py310: + if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'a9-py310') }} + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up QEMU 🌈 + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx ✨ + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub 🎪 + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and deploy image 🐳 + uses: docker/build-push-action@v5 + with: + context: docker + file: docker/Dockerfile_alma9_py310 + platforms: linux/amd64,linux/arm64 + push: ${{ github.event.inputs.build_only != 'true' }} + tags: riga/law:a9-py310 + + a9-py311: + if: ${{ github.event.inputs.specific_job == '' || contains(github.event.inputs.specific_job, 'a9-py311') }} + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up QEMU 🌈 + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx ✨ + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub 🎪 + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and deploy image 🐳 + uses: docker/build-push-action@v5 + with: + context: docker + file: docker/Dockerfile_alma9_py311 + platforms: linux/amd64,linux/arm64 + push: ${{ github.event.inputs.build_only != 'true' }} + tags: riga/law:a9-py311 diff --git a/.github/workflows/deploy_images_c7.yml b/.github/workflows/deploy_images_c7.yml index 38a535af..5a65fb56 100644 --- a/.github/workflows/deploy_images_c7.yml +++ b/.github/workflows/deploy_images_c7.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false @@ -60,24 +60,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos7_py37 @@ -90,24 +90,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos7_py38 @@ -120,24 +120,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos7_py39 @@ -150,24 +150,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos7_py310 diff --git a/.github/workflows/deploy_images_c8.yml b/.github/workflows/deploy_images_c8.yml index 33f30e49..e1ec8c7e 100644 --- a/.github/workflows/deploy_images_c8.yml +++ b/.github/workflows/deploy_images_c8.yml @@ -18,24 +18,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos8_py37 @@ -48,24 +48,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos8_py38 @@ -78,24 +78,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos8_py39 @@ -108,24 +108,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos8_py310 @@ -138,24 +138,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_centos8_py311 @@ -169,24 +169,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false - name: Set up QEMU 🌈 - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx ✨ - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub 🎪 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and deploy image 🐳 - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: docker file: docker/Dockerfile_example diff --git a/docker/Dockerfile_alma9_py310 b/docker/Dockerfile_alma9_py310 new file mode 100644 index 00000000..ae85cc8e --- /dev/null +++ b/docker/Dockerfile_alma9_py310 @@ -0,0 +1,82 @@ +FROM almalinux:9 + +ARG TARGETPLATFORM + +# labels +LABEL law.version="0.1.14" +LABEL law.image-name="riga/law" +LABEL law.image-tag="a9-py310" +LABEL law.image-os="almalinux9" +LABEL law.image-python-major="3" +LABEL law.image-python-minor="10" +LABEL law.image-python="3.10" + +# law specific environment variables +ENV LAW_IMAGE_ROOT /root/law +ENV LAW_IMAGE_NAME riga/law +ENV LAW_IMAGE_TAG a9-py310 +ENV LAW_IMAGE_PYTHON_MAJOR 3 +ENV LAW_IMAGE_PYTHON_MINOR 10 +ENV LAW_IMAGE_PYTHON ${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR} +ENV LAW_MAMBA_ROOT /root/mamba +ENV LAW_SANDBOX docker::riga/law:a9-py310 + +# exposed ports +EXPOSE 8082 + +# bash files +COPY bash_profile /root/.bash_profile +COPY bashrc /root/.bashrc + +# installation workdir +WORKDIR /root/install + +# prepare yum +RUN yum -y update; yum clean all +RUN yum -y install --allowerasing yum-utils epel-release curl wget bzip2; yum clean all + +# setup mamba +ENV MAMBA_ROOT_PREFIX "${LAW_MAMBA_ROOT}" +ENV MAMBA_EXE "${MAMBA_ROOT_PREFIX}/bin/micromamba" +ENV PATH "${MAMBA_ROOT_PREFIX}/bin:${PATH}" +RUN case "${TARGETPLATFORM}" in \ + "linux/amd64") MAMBA_PLATFORM="linux-64" ;; \ + "linux/arm64") MAMBA_PLATFORM="linux-aarch64" ;; \ + "darwin/amd64") MAMBA_PLATFORM="osx-64" ;; \ + "darwin/arm64") MAMBA_PLATFORM="osx-arm64" ;; \ + *) MAMBA_PLATFORM="linux-64" ;; \ + esac && \ + mkdir -p "${MAMBA_ROOT_PREFIX}" && \ + curl -Ls "https://micro.mamba.pm/api/micromamba/${MAMBA_PLATFORM}/latest" | tar -xvj -C "${MAMBA_ROOT_PREFIX}" "bin/micromamba" +RUN echo $'\n\ +changeps1: false\n\ +always_yes: true\n\ +channels:\n\ + - conda-forge\n\ +' >> "${MAMBA_ROOT_PREFIX}/.condarc" +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-c"] + +# mamba packages +RUN micromamba install "python=${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR}" gcc which wget nano micro git git-lfs cmake ncurses readline && \ + micromamba clean --all +RUN micromamba install gfal2 gfal2-util python-gfal2 && \ + micromamba clean --all + +# python packages +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir --upgrade setuptools +RUN pip install --no-cache-dir slackclient python-telegram-bot +RUN pip install --no-cache-dir "flake8<6" flake8-quotes flake8-commas pytest-cov + +# cleanup installation workdir +WORKDIR /root +RUN rm -rf /root/install + +# install law master +RUN git clone --recursive https://github.com/riga/law "${LAW_IMAGE_ROOT}" && \ + cd "${LAW_IMAGE_ROOT}" && \ + pip install --no-cache-dir . +WORKDIR ${LAW_IMAGE_ROOT} + +# default shell +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-i", "--login"] diff --git a/docker/Dockerfile_alma9_py311 b/docker/Dockerfile_alma9_py311 new file mode 100644 index 00000000..6d5d5467 --- /dev/null +++ b/docker/Dockerfile_alma9_py311 @@ -0,0 +1,82 @@ +FROM almalinux:9 + +ARG TARGETPLATFORM + +# labels +LABEL law.version="0.1.14" +LABEL law.image-name="riga/law" +LABEL law.image-tag="a9-py311" +LABEL law.image-os="almalinux9" +LABEL law.image-python-major="3" +LABEL law.image-python-minor="11" +LABEL law.image-python="3.11" + +# law specific environment variables +ENV LAW_IMAGE_ROOT /root/law +ENV LAW_IMAGE_NAME riga/law +ENV LAW_IMAGE_TAG a9-py311 +ENV LAW_IMAGE_PYTHON_MAJOR 3 +ENV LAW_IMAGE_PYTHON_MINOR 11 +ENV LAW_IMAGE_PYTHON ${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR} +ENV LAW_MAMBA_ROOT /root/mamba +ENV LAW_SANDBOX docker::riga/law:a9-py311 + +# exposed ports +EXPOSE 8082 + +# bash files +COPY bash_profile /root/.bash_profile +COPY bashrc /root/.bashrc + +# installation workdir +WORKDIR /root/install + +# prepare yum +RUN yum -y update; yum clean all +RUN yum -y install --allowerasing yum-utils epel-release curl wget bzip2; yum clean all + +# setup mamba +ENV MAMBA_ROOT_PREFIX "${LAW_MAMBA_ROOT}" +ENV MAMBA_EXE "${MAMBA_ROOT_PREFIX}/bin/micromamba" +ENV PATH "${MAMBA_ROOT_PREFIX}/bin:${PATH}" +RUN case "${TARGETPLATFORM}" in \ + "linux/amd64") MAMBA_PLATFORM="linux-64" ;; \ + "linux/arm64") MAMBA_PLATFORM="linux-aarch64" ;; \ + "darwin/amd64") MAMBA_PLATFORM="osx-64" ;; \ + "darwin/arm64") MAMBA_PLATFORM="osx-arm64" ;; \ + *) MAMBA_PLATFORM="linux-64" ;; \ + esac && \ + mkdir -p "${MAMBA_ROOT_PREFIX}" && \ + curl -Ls "https://micro.mamba.pm/api/micromamba/${MAMBA_PLATFORM}/latest" | tar -xvj -C "${MAMBA_ROOT_PREFIX}" "bin/micromamba" +RUN echo $'\n\ +changeps1: false\n\ +always_yes: true\n\ +channels:\n\ + - conda-forge\n\ +' >> "${MAMBA_ROOT_PREFIX}/.condarc" +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-c"] + +# mamba packages +RUN micromamba install "python=${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR}" gcc which wget nano micro git git-lfs cmake ncurses readline && \ + micromamba clean --all +RUN micromamba install gfal2 gfal2-util python-gfal2 && \ + micromamba clean --all + +# python packages +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir --upgrade setuptools +RUN pip install --no-cache-dir slackclient python-telegram-bot +RUN pip install --no-cache-dir "flake8<6" flake8-quotes flake8-commas pytest-cov + +# cleanup installation workdir +WORKDIR /root +RUN rm -rf /root/install + +# install law master +RUN git clone --recursive https://github.com/riga/law "${LAW_IMAGE_ROOT}" && \ + cd "${LAW_IMAGE_ROOT}" && \ + pip install --no-cache-dir . +WORKDIR ${LAW_IMAGE_ROOT} + +# default shell +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-i", "--login"] diff --git a/docker/Dockerfile_alma9_py37 b/docker/Dockerfile_alma9_py37 index 4e88b70b..534f794e 100644 --- a/docker/Dockerfile_alma9_py37 +++ b/docker/Dockerfile_alma9_py37 @@ -33,7 +33,7 @@ WORKDIR /root/install # prepare yum RUN yum -y update; yum clean all -RUN yum -y install yum-utils epel-release curl wget bzip2 --allowerasing; yum clean all +RUN yum -y install --allowerasing yum-utils epel-release curl wget bzip2; yum clean all # setup mamba ENV MAMBA_ROOT_PREFIX "${LAW_MAMBA_ROOT}" diff --git a/docker/Dockerfile_alma9_py38 b/docker/Dockerfile_alma9_py38 new file mode 100644 index 00000000..23b7396c --- /dev/null +++ b/docker/Dockerfile_alma9_py38 @@ -0,0 +1,82 @@ +FROM almalinux:9 + +ARG TARGETPLATFORM + +# labels +LABEL law.version="0.1.14" +LABEL law.image-name="riga/law" +LABEL law.image-tag="a9-py38" +LABEL law.image-os="almalinux9" +LABEL law.image-python-major="3" +LABEL law.image-python-minor="8" +LABEL law.image-python="3.8" + +# law specific environment variables +ENV LAW_IMAGE_ROOT /root/law +ENV LAW_IMAGE_NAME riga/law +ENV LAW_IMAGE_TAG a9-py38 +ENV LAW_IMAGE_PYTHON_MAJOR 3 +ENV LAW_IMAGE_PYTHON_MINOR 8 +ENV LAW_IMAGE_PYTHON ${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR} +ENV LAW_MAMBA_ROOT /root/mamba +ENV LAW_SANDBOX docker::riga/law:a9-py38 + +# exposed ports +EXPOSE 8082 + +# bash files +COPY bash_profile /root/.bash_profile +COPY bashrc /root/.bashrc + +# installation workdir +WORKDIR /root/install + +# prepare yum +RUN yum -y update; yum clean all +RUN yum -y install --allowerasing yum-utils epel-release curl wget bzip2; yum clean all + +# setup mamba +ENV MAMBA_ROOT_PREFIX "${LAW_MAMBA_ROOT}" +ENV MAMBA_EXE "${MAMBA_ROOT_PREFIX}/bin/micromamba" +ENV PATH "${MAMBA_ROOT_PREFIX}/bin:${PATH}" +RUN case "${TARGETPLATFORM}" in \ + "linux/amd64") MAMBA_PLATFORM="linux-64" ;; \ + "linux/arm64") MAMBA_PLATFORM="linux-aarch64" ;; \ + "darwin/amd64") MAMBA_PLATFORM="osx-64" ;; \ + "darwin/arm64") MAMBA_PLATFORM="osx-arm64" ;; \ + *) MAMBA_PLATFORM="linux-64" ;; \ + esac && \ + mkdir -p "${MAMBA_ROOT_PREFIX}" && \ + curl -Ls "https://micro.mamba.pm/api/micromamba/${MAMBA_PLATFORM}/latest" | tar -xvj -C "${MAMBA_ROOT_PREFIX}" "bin/micromamba" +RUN echo $'\n\ +changeps1: false\n\ +always_yes: true\n\ +channels:\n\ + - conda-forge\n\ +' >> "${MAMBA_ROOT_PREFIX}/.condarc" +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-c"] + +# mamba packages +RUN micromamba install "python=${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR}" gcc which wget nano micro git git-lfs cmake ncurses readline && \ + micromamba clean --all +RUN micromamba install gfal2 gfal2-util python-gfal2 && \ + micromamba clean --all + +# python packages +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir --upgrade setuptools +RUN pip install --no-cache-dir slackclient python-telegram-bot +RUN pip install --no-cache-dir "flake8<6" flake8-quotes flake8-commas pytest-cov + +# cleanup installation workdir +WORKDIR /root +RUN rm -rf /root/install + +# install law master +RUN git clone --recursive https://github.com/riga/law "${LAW_IMAGE_ROOT}" && \ + cd "${LAW_IMAGE_ROOT}" && \ + pip install --no-cache-dir . +WORKDIR ${LAW_IMAGE_ROOT} + +# default shell +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-i", "--login"] diff --git a/docker/Dockerfile_alma9_py39 b/docker/Dockerfile_alma9_py39 new file mode 100644 index 00000000..9aab75e6 --- /dev/null +++ b/docker/Dockerfile_alma9_py39 @@ -0,0 +1,82 @@ +FROM almalinux:9 + +ARG TARGETPLATFORM + +# labels +LABEL law.version="0.1.14" +LABEL law.image-name="riga/law" +LABEL law.image-tag="a9-py39" +LABEL law.image-os="almalinux9" +LABEL law.image-python-major="3" +LABEL law.image-python-minor="9" +LABEL law.image-python="3.9" + +# law specific environment variables +ENV LAW_IMAGE_ROOT /root/law +ENV LAW_IMAGE_NAME riga/law +ENV LAW_IMAGE_TAG a9-py39 +ENV LAW_IMAGE_PYTHON_MAJOR 3 +ENV LAW_IMAGE_PYTHON_MINOR 9 +ENV LAW_IMAGE_PYTHON ${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR} +ENV LAW_MAMBA_ROOT /root/mamba +ENV LAW_SANDBOX docker::riga/law:a9-py39 + +# exposed ports +EXPOSE 8082 + +# bash files +COPY bash_profile /root/.bash_profile +COPY bashrc /root/.bashrc + +# installation workdir +WORKDIR /root/install + +# prepare yum +RUN yum -y update; yum clean all +RUN yum -y install --allowerasing yum-utils epel-release curl wget bzip2; yum clean all + +# setup mamba +ENV MAMBA_ROOT_PREFIX "${LAW_MAMBA_ROOT}" +ENV MAMBA_EXE "${MAMBA_ROOT_PREFIX}/bin/micromamba" +ENV PATH "${MAMBA_ROOT_PREFIX}/bin:${PATH}" +RUN case "${TARGETPLATFORM}" in \ + "linux/amd64") MAMBA_PLATFORM="linux-64" ;; \ + "linux/arm64") MAMBA_PLATFORM="linux-aarch64" ;; \ + "darwin/amd64") MAMBA_PLATFORM="osx-64" ;; \ + "darwin/arm64") MAMBA_PLATFORM="osx-arm64" ;; \ + *) MAMBA_PLATFORM="linux-64" ;; \ + esac && \ + mkdir -p "${MAMBA_ROOT_PREFIX}" && \ + curl -Ls "https://micro.mamba.pm/api/micromamba/${MAMBA_PLATFORM}/latest" | tar -xvj -C "${MAMBA_ROOT_PREFIX}" "bin/micromamba" +RUN echo $'\n\ +changeps1: false\n\ +always_yes: true\n\ +channels:\n\ + - conda-forge\n\ +' >> "${MAMBA_ROOT_PREFIX}/.condarc" +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-c"] + +# mamba packages +RUN micromamba install "python=${LAW_IMAGE_PYTHON_MAJOR}.${LAW_IMAGE_PYTHON_MINOR}" gcc which wget nano micro git git-lfs cmake ncurses readline && \ + micromamba clean --all +RUN micromamba install gfal2 gfal2-util python-gfal2 && \ + micromamba clean --all + +# python packages +RUN pip install --no-cache-dir --upgrade pip +RUN pip install --no-cache-dir --upgrade setuptools +RUN pip install --no-cache-dir slackclient python-telegram-bot +RUN pip install --no-cache-dir "flake8<6" flake8-quotes flake8-commas pytest-cov + +# cleanup installation workdir +WORKDIR /root +RUN rm -rf /root/install + +# install law master +RUN git clone --recursive https://github.com/riga/law "${LAW_IMAGE_ROOT}" && \ + cd "${LAW_IMAGE_ROOT}" && \ + pip install --no-cache-dir . +WORKDIR ${LAW_IMAGE_ROOT} + +# default shell +SHELL ["micromamba", "run", "-n", "base", "/bin/bash", "-i", "--login"]