diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2b424a..06f01dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,11 +40,3 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Install dependencies 📦 - run: | - pip install -r requirements.txt - pip freeze - - # - name: Run tests - # run: pytest -m "${{ inputs.integration && 'integration' || 'not integration' }}" --target ${{inputs.target}} - # env: ${{ fromJSON(inputs.images) }} diff --git a/README.md b/README.md index 4692e6c..e68f0a3 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,13 @@ Meanwhile, I cumulated a lot of experience on how to build aiida/aiidalab images Compiling codes within computational materials community is not always trivial. One of the main goals of Quantum Mobile is bring pre-installed tools/codes to users. Historically, we had switch from using ansible to store the compiling recipe to using conda. The efforts are enssential for the Quantum Mobile itself but hard to find motivation for the community. -In a long time, I use the `containers4hpc/quantum-espresso` image for multiple different purposes such as for testing my aiida plugin with setting as containerized code. +In a long time, I use the `cnts4sci/quantum-espresso` image for multiple different purposes such as for testing my aiida plugin with setting as containerized code. It potentially can fit a bigger picture. Compiling need only happened once in the image repo of the code. The binary can be copy from layer into the final image of Quantum Container. TODO -- [ ] pre-configured AiiDA in full-stack +- [x] pre-configured AiiDA in full-stack - [x] developers sugar tools. - [ ] OPENMPI into base and fix the version range to compatible with `build-machine` - [ ] use /dev/shm ? check. @@ -41,7 +41,7 @@ TODO - [ ] commandline wrapper to start container with designed parameters such as resolution of vnc server. - [ ] Docker desktop for windows, test and documentation. - [ ] At the moment, we copy binaries of every codes to `/usr/local/bin`, there might be conflication on names. -- [ ] Change org name containers4hpc -> containers4sci or cnts4sci or containers4science +- [x] Change org name containers4hpc -> containers4sci or cnts4sci (I choose this) or containers4science - [ ] Docker test using `testcontainers-rc`. - [x] gracefully shutdown the vncserver, 1. avoid to show the error message, 2. handle save and clean up of vnc session. - [ ] instructions as a icon that start the browser page to the tutorial. @@ -51,7 +51,7 @@ TODO ### How to run ```bash -docker run -d -p 6080:6080 ghcr.io/containers4hpc/qc-base +docker run -d -p 6080:6080 ghcr.io/cnts4sci/qc-base ``` In your browser open http://localhost:6080, click the connect button and input the password `moritz`. You are ready to use the Linux system. diff --git a/build.json b/build.json index b4f921e..1ba815b 100644 --- a/build.json +++ b/build.json @@ -1,13 +1,16 @@ { "variable": { "QUANTUM_ESPRESSO_IMAGE": { - "default": "ghcr.io/containers4hpc/quantum-espresso:v2024.1001" + "default": "ghcr.io/cnts4sci/quantum-espresso:v2024.1001" }, "ATOMPAW_IMAGE": { "default": "ghcr.io/pspgen/atompaw:atompaw-4.2.0.3" }, "ONCVPSP_IMAGE": { "default": "ghcr.io/pspgen/oncvpsp:oncvpsp-4.0.1" + }, + "AIIDA_CORE_VERSION": { + "default": "2.5.2" } } } diff --git a/docker-bake.hcl b/docker-bake.hcl index c51768e..92b5214 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -3,7 +3,7 @@ variable "VERSION" { } variable "ORGANIZATION" { - default = "containers4hpc" + default = "cnts4sci" } variable "REGISTRY" { @@ -15,7 +15,7 @@ variable "PLATFORMS" { } variable "TARGETS" { - default = ["qc-base", "qc-full-stack"] + default = ["qc-base", "qc-full-stack", "qc-aiida"] } # TAGS for softwares @@ -45,6 +45,19 @@ target "qc-base" { } } +target "qc-aiida" { + tags = tags("qc-aiida") + context = "qc-aiida" + contexts = { + runtime-base-image = "target:qc-base" + python-base-image = "docker-image://ghcr.io/cnts4sci/python:edge" + } + platforms = "${PLATFORMS}" + args = { + AIIDA_CORE_VERSION = "${AIIDA_CORE_VERSION}" + } +} + target "qc-full-stack" { tags = tags("qc-full-stack") context = "qc-full-stack" diff --git a/qc-aiida/Dockerfile b/qc-aiida/Dockerfile new file mode 100644 index 0000000..d9f34bc --- /dev/null +++ b/qc-aiida/Dockerfile @@ -0,0 +1,55 @@ +# syntax=docker/dockerfile:1 + +ARG AIIDA_CORE_VERSION + +FROM python-base-image as python-carrier + + +# This is not needed since qc-base use SYSTEM_USER but better to set +# to emphasis it. +USER ${SYSTEM_USER} + +# set up your python path +ENV PATH=/opt/python/bin:${PATH} +ENV LD_LIBRARY_PATH=/opt/python/lib:${LD_LIBRARY_PATH} +ENV C_INCLUDE_PATH=/opt/python/include:${C_INCLUDE_PATH} + +# Create a venv named `aiida-runtime` in home +# Install aiida-core and other plugins (???) to the venv +RUN python -m venv ${HOME}/venv/aiida-runtime && \ + source ${HOME}/venv/aiida-runtime/bin/activate && \ + python -m pip install aiida-core==${AIIDA_CORE_VERSION} + +# Create workdir_aiida under ~ and init the profile. +RUN mkdir -p ${HOME}/workdir_aiida && \ + verdi setup --non-interactive --config default-profile.yaml + +# FROM runtime-base-image +# +# USER root +# # To do this I need RMQ and Sqlite (include in python already) +# # Install erlang and RMQ +# # TODO: simplify me +# WORKDIR /opt +# +# RUN apt-get update --yes && \ +# apt-get install --yes --no-install-recommends \ +# erlang && \ +# apt-get clean && rm -rf /var/lib/apt/lists/* && \ +# # Install rabbitmq. +# wget -c -O rmq.tar.xz --no-check-certificate https://github.com/rabbitmq/rabbitmq-server/releases/download/v${RMQ_VERSION}/rabbitmq-server-generic-unix-${RMQ_VERSION}.tar.xz && \ +# mkdir rmq && \ +# tar xf rmq.tar.xz -C rmq --strip-components=1 && \ +# rm rmq.tar.xz +# +# COPY --from=aiida-build-image /opt/python /opt/python +# COPY --from=aiida-build-image ${HOME}/venv/aiida-runtime ${HOME}/ven/aiida-runtime +# COPY --from=aiida-build-image ${HOME}/workdir_aiida ${HOME}/workdir_aiida +# +# # set up python path +# ENV PATH=${HOME}/venv/aiida-runtime/bin:${PATH} +# ENV LD_LIBRARY_PATH=${HOME}/venv/aiida-runtime/lib:${LD_LIBRARY_PATH} +# ENV C_INCLUDE_PATH=${HOME}/venv/aiida-runtime/include:${C_INCLUDE_PATH} +# +# # set up rmq path +# ENV PATH=/opt/rmq/sbin:${PATH} diff --git a/qc-full-stack/Dockerfile b/qc-full-stack/Dockerfile index 22ccfb4..bc6caf6 100644 --- a/qc-full-stack/Dockerfile +++ b/qc-full-stack/Dockerfile @@ -15,6 +15,7 @@ # - bigdfd # - DFTK # - siesta +# - gpaw: -> https://hub.docker.com/r/marcindulak/gpaw-openmpi # ARG need to put all infront of multi-stage FROM ARG QUANTUM_ESPRESSO_IMAGE