diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 792fd07..9b85400 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -36,7 +36,21 @@ jobs: # checkout source code - uses: actions/checkout@v3 - # calculate some variables that are used later + # calculate component version information + - name: component version information + run: | + CHANNEL=$(cat config.yml | grep "Channel" | head -1 | awk -F ": " '{print $2}' | sed 's/["[:space:]]//g') + INCORE_VERSION=$(cat config.yml | grep "INCORE_VERSION" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]_]//g" | sed "s/-//g") + PYINCORE_VERSION=$(cat config.yml | grep "PyIncore" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + PYINCORE_VIZ_VERSION=$(cat config.yml | grep "PyIncore-Viz" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + PYINCORE_DATA_VERSION=$(cat config.yml | grep "PyIncore-Data" | head -1 | awk -F= "{print $2 }" | sed "s/[[:alpha:]|,|-|\"|:|#|[:space:]]//g" | sed "s/-//g") + echo "CHANNEL=${CHANNEL}" >> $GITHUB_ENV + echo "INCORE_VERSION=${INCORE_VERSION}" >> $GITHUB_ENV + echo "PYINCORE_VERSION=${PYINCORE_VERSION}" >> $GITHUB_ENV + echo "PYINCORE_VIZ_VERSION=${PYINCORE_VIZ_VERSION}" >> $GITHUB_ENV + echo "PYINCORE_DATA_VERSION=${PYINCORE_DATA_VERSION}" >> $GITHUB_ENV + + # calculate branch version information - name: version information run: | echo ${GITHUB_REF_NAME} @@ -118,6 +132,16 @@ jobs: echo "VERSION=${version}" >> $GITHUB_ENV echo "TAGS=${push_tags}" >> $GITHUB_ENV + # print version information + - name: Print Version information + run: | + echo "${{ env.TAGS }}" + echo "${{ env.CHANNEL }}" + echo "${{ env.INCORE_VERSION }}" + echo "${{ env.PYINCORE_VERSION }}" + echo "${{ env.PYINCORE_VIZ_VERSION }}" + echo "${{ env.PYINCORE_DATA_VERSION }}" + # setup docker build - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -168,6 +192,12 @@ jobs: cache-from: type=gha,scope=${{ env.BRANCH }}-${{ matrix.name }} cache-to: type=gha,scope=${{ env.BRANCH }}-${{ matrix.name }},mode=max tags: ${{ env.TAGS }} + build-args: | + INCORE=${{ env.INCORE_VERSION }} + PYINCORE=${{ env.PYINCORE_VERSION }} + PYINCORE_VIZ=${{ env.PYINCORE_VIZ_VERSION }} + PYINCORE_DATA=${{ env.PYINCORE_DATA_VERSION }} + CHANNEL=${{ env.CHANNEL }} # update README at DockerHub # - name: Docker Hub Description diff --git a/CHANGELOG.md b/CHANGELOG.md index eb13b6c..c9d75d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - +### Added + +- Config file for controlling component versions and github action [#86](https://github.com/IN-CORE/incore-lab/issues/86) + ### Changed -- DockerFile now uses libmamba installation to install python dependencies and github workflow is not run on ARM architecture [#75](https://github.com/IN-CORE/incore-lab/issues/75) + +- DockerFile now uses mamba to install python dependencies [#84](https://github.com/IN-CORE/incore-lab/issues/84) +- Github Action workflow is no longer run on ARM architecture [#75](https://github.com/IN-CORE/incore-lab/issues/75) ## [1.1.0] - 2023-11-08 ### Changed + - INCORE-Lab now uses Pyincore version 1.14.0 [#76](https://github.com/IN-CORE/incore-lab/issues/76) - INCORE-Lab now uses Pyincore-viz version 1.8.4 [#76](https://github.com/IN-CORE/incore-lab/issues/76) @@ -21,7 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Dockerfile for hub to use version 3.0.2 [#57](https://github.com/IN-CORE/incore-lab/issues/57) -- Dockerfile for lab to use version 4.0.2 respectively [#56]( https://github.com/IN-CORE/incore-lab/issues/56) +- Dockerfile for lab to use version 4.0.2 respectively [#56](https://github.com/IN-CORE/incore-lab/issues/56) ### Added diff --git a/Dockerfile.lab b/Dockerfile.lab index e33f7ae..433d04d 100644 --- a/Dockerfile.lab +++ b/Dockerfile.lab @@ -17,33 +17,33 @@ USER $NB_USER # IN-CORE variables, set these to control versions to be installed # use --build-arg CHANNEL=in-core/label/rc to install a RC version ARG CHANNEL="in-core" -ARG PYINCORE="1.14.0" -ARG PYINCORE_VIZ="1.8.4" -ARG PYINCORE_DATA="0.6.0" -ARG INCORE="4.7.0" +ARG PYINCORE="latest" +ARG PYINCORE_VIZ="latest" +ARG PYINCORE_DATA="latest" +ARG INCORE="latest" # store versions installed as environment variables -ENV INCORE=${INCORE} \ - PYINCORE=${PYINCORE} \ - PYINCORE_VIZ=${PYINCORE_VIZ} \ - PYINCORE_DATA=${PYINCORE_DATA} +ENV INCORE=$INCORE \ + PYINCORE=$PYINCORE \ + PYINCORE_VIZ=$PYINCORE_VIZ \ + PYINCORE_DATA=$PYINCORE_DATA \ + CHANNEL=$CHANNEL -# Set conda channels and solver -RUN conda config --add channels conda-forge && \ - conda config --add channels in-core && \ - conda install -c conda-forge conda-libmamba-solver && \ - conda config --set solver libmamba +# Install Mamba from Conda-Forge +RUN conda install -c conda-forge mamba -# install pyincore, pyincore-viz and other conda packages -# mamba files installed will now have rw for others. Use find to collect -# names of files installed and chane permissions. +# Set mamba channels +RUN mamba config --add channels conda-forge && \ + mamba config --add channels in-core + +# Install pyincore, pyincore-viz and other mamba packages RUN umask 0 && \ find /opt/conda ! -perm -o=w -print | sort > /tmp/oldfiles && \ - conda install -c ${CHANNEL} -y \ + mamba install -c ${CHANNEL} -y \ pyincore=${PYINCORE} \ pyincore-viz=${PYINCORE_VIZ} \ pyincore-data=${PYINCORE_DATA} && \ - conda clean --yes --all --force-pkgs-dirs && \ + mamba clean --yes --all --force-pkgs-dirs && \ find /opt/conda ! -perm -o=w -print | sort > /tmp/newfiles && \ - comm -13 /tmp/oldfiles /tmp/newfiles | xargs -d '\n' -n 100 chmod a+w && \ + comm -13 /tmp/oldfiles /tmp/newfiles | xargs -d '\n' -n 100 chmod a+w && \ rm -f /tmp/oldfiles /tmp/newfiles \ No newline at end of file diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..62dcb1a --- /dev/null +++ b/config.yml @@ -0,0 +1,9 @@ +title: "IN-CORE Lab component version information" +project: "IN-CORE Lab" +author: "Yong Wook Kim" +Channel: "in-core" +# version form must be "x.x.x" +INCORE_VERSION: "4.7.0" +PyIncore: "1.14.0" +PyIncore-Viz: "1.8.4" +PyIncore-Data: "0.6.0" \ No newline at end of file