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 config file for controlling lab components #87

32 changes: 31 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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

Expand Down
38 changes: 19 additions & 19 deletions Dockerfile.lab
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -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"