diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 9497bdc..a36af61 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - 'main' env: REGISTRY: ghcr.io @@ -40,6 +37,15 @@ jobs: uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch,enable=${{ github.ref == 'refs/heads/main' }} + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Build and push Docker image id: push @@ -47,8 +53,11 @@ jobs: with: context: . push: true + platforms: linux/amd64, linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha, mode=max - name: Generate artifact attestation uses: actions/attest@v4 diff --git a/Dockerfile b/Dockerfile index 0b7d7de..1ff2555 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ COPY . . RUN mkdir build && cd build && \ cmake .. && \ - make + make -j$(nproc) RUN cd build/mcmpy && \ /opt/venv/bin/pip install . diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index 3e9d974..56af51b 100644 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -12,28 +12,33 @@ Installation using Docker ------------------------- First `install Docker `_. -Then clone the GitHub repository and build the Docker image. +Create or navigate to the folder that contains all input files necessary for the data analysis and save the following block of code as a file named `docker-compose.yml`: -.. code-block:: bash +.. code-block:: yaml - git clone --recursive git@github.com:DM-Lab-UvA/MinCompSpin.git - cd MinCompSpin - docker build -t mincompspin . + services: + mincompspin: + image: ghcr.io/dm-lab-uva/mincompspin:latest + ports: + - "8888:8888" + volumes: + - .:/MinCompSpin + command: jupyter notebook --ip=0.0.0.0 --no-browser --allow-root -After building the image, you can run the container: +To launch the container environment, open a terminal in your directory and execute the following command: .. code-block:: bash - docker run -p 8888:8888 -it mincompspin + docker compose up -To run a Jupyter notebook in the Docker container +When running the command for the first time, it will download the pre-built Docker image and automatically start a jupyter server. +This returns a link beginning with ``127.0.0.1``, which can be opened in a local browser. +Next times, it will not download the latest Docker image but just launch a container with this downloaded version. +If a newer version of the image exists, run the following command first: .. code-block:: bash - jupyter notebook --ip=0.0.0.0 --no-browser --allow-root - -This returns a link beginning with ``127.0.0.1``, which can be opened in a local browser. - + docker compose pull Local installation using CMake ------------------------------