From 6c853fe7705b4be913acc3368d7c4bc8417a3c6c Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 6 Oct 2024 10:43:14 -0400 Subject: [PATCH 1/7] Update to 3-clause bsd with attribution --- LICENSE | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index fe94421f0..625d13668 100644 --- a/LICENSE +++ b/LICENSE @@ -3,9 +3,8 @@ Copyright © 2024 Fluid Numerics LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +4. Redistributions of any form whatsoever must retain the following acknowledgment: 'This product includes software developed by "Fluid Numerics LLC (https://www.fluidnumerics.com)"' -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file From aa7bbc628bb44ac61e1b7a1e6599450e47fc4d82 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 6 Oct 2024 14:56:45 -0400 Subject: [PATCH 2/7] Update README on license and support; add funding --- .github/FUNDING.yml | 13 +++++++++++++ README.md | 11 +++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..748aabbb2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +# patreon: # Replace with a single Patreon username +open_collective: opensource-fluidnumerics +# ko_fi: # Replace with a single Ko-fi username +# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +# liberapay: # Replace with a single Liberapay username +# issuehunt: # Replace with a single IssueHunt username +# otechie: # Replace with a single Otechie username +# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] \ No newline at end of file diff --git a/README.md b/README.md index 57a6fbf2d..527a1d389 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,16 @@ Copyright 2020-2023 Fluid Numerics LLC [![linux-amdflang-cmake](https://github.com/FluidNumerics/SELF/actions/workflows/linux-amdflang-cmake.yaml/badge.svg)](https://github.com/FluidNumerics/SELF/actions/workflows/linux-amdflang-cmake.yaml) ## Licensing -SELF is licensed for use under a [non-commercial use visible-source license](./LICENSE). Fluid Numerics is a small family-owned business and wants to make SELF available to researchers for academic use. Under the license, you can use, modify, and redistribute SELF so long as attribution is given to Fluid Numerics. However, since we are interested in protecting our time-and-effort investment in SELF, sale and commercial-use of SELF is prohibited under the license. +SELF is licensed for use under a [3 Clause BSD with attribution license](./LICENSE). [Fluid Numerics](https://www.fluidnumerics.com) is a small family-owned business. We want to make SELF available to folks who want to build conservation laws that run on a wide range of platforms. Under the license, you can use, modify, and redistribute SELF so long as attribution is given to Fluid Numerics. -If you are interested in commercial licensure and would like support from Fluid Numerics, reach out to support@fluidnumerics.com +## How to support this repository +Continued support of SELF relies on users and customers. Here's a few ways you can support this project: + +* Give this repository a star on Github +* [Open an issue](https://github.com/FluidNumerics/SELF/issues/new/choose) if you have a question or want to report a problem. We want to help! +* [Subscribe to Fluid Numerics on Youtube](https://www.youtube.com/@FluidNumerics?sub_confirmation=1) +* [Sponsor this project on Open Collective](https://opencollective.com/opensource-fluidnumerics) +* [Work with us](https://www.fluidnumerics.com/services) ## About SELF is an object-oriented Fortran library that support the implementation of Spectral Element Methods for solving partial differential equations. From fa61aff0743538b2bfe56a2420752c51b3ed7838 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 6 Oct 2024 14:57:54 -0400 Subject: [PATCH 3/7] Add Dockerfile for building SELF for multithread cpu-only platforms --- cloudbuild.yaml | 8 +++++ docker/x86_64/Dockerfile | 70 ++++++++++++++++++++++++++++++++++++++++ docker/x86_64/spack.yaml | 25 ++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 cloudbuild.yaml create mode 100644 docker/x86_64/Dockerfile create mode 100644 docker/x86_64/spack.yaml diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 000000000..0440bf03f --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,8 @@ +steps: +- name: 'gcr.io/cloud-builders/docker' + script: | + docker build -f docker/x86_64/Dockerfile \ + -t 'us-docker.pkg.dev/$PROJECT_ID/self/self-x86_64:$REF_NAME' + automapSubstitutions: true +images: +- 'us-docker.pkg.dev/$PROJECT_ID/self/self-x86_64:$REF_NAME' \ No newline at end of file diff --git a/docker/x86_64/Dockerfile b/docker/x86_64/Dockerfile new file mode 100644 index 000000000..a37f2d8f6 --- /dev/null +++ b/docker/x86_64/Dockerfile @@ -0,0 +1,70 @@ +# Build stage with Spack pre-installed and ready to be used +FROM spack/rockylinux8:develop AS builder + + +# What we want to install and how we want to install it +# is specified in a manifest file (spack.yaml) + +RUN mkdir -p /opt/spack-environment && \ +set -o noclobber \ +&& (echo spack: \ +&& echo ' specs:' \ +&& echo ' - feq-parse@2.2.2' \ +&& echo ' - openmpi@5.0.2' \ +&& echo ' - hdf5@1.14.3 +fortran +mpi' \ +&& echo ' concretizer:' \ +&& echo ' unify: when_possible' \ +&& echo ' config:' \ +&& echo ' install_tree: /opt/software' \ +&& echo ' view: /opt/views/view') > /opt/spack-environment/spack.yaml + +# Install the software, remove unnecessary deps +RUN cd /opt/spack-environment && spack info openmpi && spack env activate . && spack install --fail-fast && spack gc -y + +# Strip all the binaries +RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \ + xargs file -i | \ + grep 'charset=binary' | \ + grep 'x-executable\|x-archive\|x-sharedlib' | \ + awk -F: '{print $1}' | xargs strip + +# Modifications to the environment that are necessary to run +RUN cd /opt/spack-environment && \ + spack env activate --sh -d . > activate.sh + +RUN spack env activate -d /opt/spack-environment && \ + mkdir build && cd build && \ + cmake -DCMAKE_BUILD_TYPE=release \ + -DSELF_ENABLE_MULTITHREADING=ON \ + -DCMAKE_INSTALL_PREFIX=/opt/views/view \ + ../ && \ + make VERBOSE=1 && \ + make install + +# Bare OS image to run the installed executables +FROM docker.io/rockylinux:8 + +COPY --from=builder /opt/spack-environment /opt/spack-environment +COPY --from=builder /opt/software /opt/software + +# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it +COPY --from=builder /opt/views /opt/views + +RUN { \ + echo '#!/bin/sh' \ + && echo '.' /opt/spack-environment/activate.sh \ + && echo 'exec "$@"'; \ + } > /entrypoint.sh \ +&& chmod a+x /entrypoint.sh \ +&& ln -s /opt/views/view /opt/view + + +LABEL "app"="self" +LABEL "mpi"="openmpi@5.0.2" +LABEL "platform"="x86_64" +LABEL "gpu"="none" +LABEL "hdf5"="1.14.3" +LABEL "feqparse"="2.2.2" +ENTRYPOINT [ "/entrypoint.sh" ] +CMD [ "/bin/bash" ] + diff --git a/docker/x86_64/spack.yaml b/docker/x86_64/spack.yaml new file mode 100644 index 000000000..e9e952827 --- /dev/null +++ b/docker/x86_64/spack.yaml @@ -0,0 +1,25 @@ +spack: + specs: + - feq-parse@2.2.2 + - openmpi@5.0.2 + - hdf5@1.14.3 +fortran +mpi + + container: + # Select the format of the recipe e.g. docker, + # singularity or anything else that is currently supported + format: docker + + # Sets the base images for the stages where Spack builds the + # software or where the software gets installed after being built.. + images: + os: "rockylinux:8" + spack: develop + + # Labels for the image + labels: + app: "self" + mpi: "openmpi@5.0.2" + platform: "x86_64" + gpu: "none" + hdf5: "1.14.3" + feqparse: "2.2.2" \ No newline at end of file From a3c09f21c3b60e549038aca1ed32598097bf0c2c Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 6 Oct 2024 15:32:30 -0400 Subject: [PATCH 4/7] Add cmake to environment --- docker/x86_64/Dockerfile | 1 + docker/x86_64/spack.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/docker/x86_64/Dockerfile b/docker/x86_64/Dockerfile index a37f2d8f6..3ba8e924c 100644 --- a/docker/x86_64/Dockerfile +++ b/docker/x86_64/Dockerfile @@ -9,6 +9,7 @@ RUN mkdir -p /opt/spack-environment && \ set -o noclobber \ && (echo spack: \ && echo ' specs:' \ +&& echo ' - cmake@3.29.6' \ && echo ' - feq-parse@2.2.2' \ && echo ' - openmpi@5.0.2' \ && echo ' - hdf5@1.14.3 +fortran +mpi' \ diff --git a/docker/x86_64/spack.yaml b/docker/x86_64/spack.yaml index e9e952827..9e0714f5c 100644 --- a/docker/x86_64/spack.yaml +++ b/docker/x86_64/spack.yaml @@ -1,5 +1,6 @@ spack: specs: + - cmake@3.29.6 - feq-parse@2.2.2 - openmpi@5.0.2 - hdf5@1.14.3 +fortran +mpi From 6f4b211e16267739bd938ed11dc4914dc824822a Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 7 Oct 2024 16:45:50 -0400 Subject: [PATCH 5/7] [WIP] Add documenation for using docker images; patch dockerfile --- docker/x86_64/Dockerfile | 49 ++++++++++++++++++----------------- docker/x86_64/spack.yaml | 4 +-- docs/GettingStarted/docker.md | 30 +++++++++++++++++++++ 3 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 docs/GettingStarted/docker.md diff --git a/docker/x86_64/Dockerfile b/docker/x86_64/Dockerfile index 3ba8e924c..810ee1822 100644 --- a/docker/x86_64/Dockerfile +++ b/docker/x86_64/Dockerfile @@ -1,39 +1,28 @@ # Build stage with Spack pre-installed and ready to be used -FROM spack/rockylinux8:develop AS builder +FROM spack/ubuntu-jammy:develop AS builder # What we want to install and how we want to install it # is specified in a manifest file (spack.yaml) - RUN mkdir -p /opt/spack-environment && \ set -o noclobber \ && (echo spack: \ && echo ' specs:' \ -&& echo ' - cmake@3.29.6' \ +&& echo ' - cmake@3.30.2' \ && echo ' - feq-parse@2.2.2' \ -&& echo ' - openmpi@5.0.2' \ +&& echo ' - openmpi@5.0.2+static' \ && echo ' - hdf5@1.14.3 +fortran +mpi' \ && echo ' concretizer:' \ -&& echo ' unify: when_possible' \ +&& echo ' unify: true' \ && echo ' config:' \ && echo ' install_tree: /opt/software' \ && echo ' view: /opt/views/view') > /opt/spack-environment/spack.yaml # Install the software, remove unnecessary deps -RUN cd /opt/spack-environment && spack info openmpi && spack env activate . && spack install --fail-fast && spack gc -y - -# Strip all the binaries -RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \ - xargs file -i | \ - grep 'charset=binary' | \ - grep 'x-executable\|x-archive\|x-sharedlib' | \ - awk -F: '{print $1}' | xargs strip - -# Modifications to the environment that are necessary to run -RUN cd /opt/spack-environment && \ - spack env activate --sh -d . > activate.sh +RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y +COPY . . -RUN spack env activate -d /opt/spack-environment && \ +RUN spack env activate -d /opt/spack-environment &&\ mkdir build && cd build && \ cmake -DCMAKE_BUILD_TYPE=release \ -DSELF_ENABLE_MULTITHREADING=ON \ @@ -42,14 +31,26 @@ RUN spack env activate -d /opt/spack-environment && \ make VERBOSE=1 && \ make install -# Bare OS image to run the installed executables -FROM docker.io/rockylinux:8 +# # # Strip all the binaries +# # RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \ +# # xargs file -i | \ +# # grep 'charset=binary' | \ +# # grep 'x-executable\|x-archive\|x-sharedlib' | \ +# # awk -F: '{print $1}' | xargs strip + +# # Modifications to the environment that are necessary to run +RUN cd /opt/spack-environment && \ + spack env activate --sh -d . > activate.sh + + +# # Bare OS image to run the installed executables +# FROM ubuntu:22.04 -COPY --from=builder /opt/spack-environment /opt/spack-environment -COPY --from=builder /opt/software /opt/software +# COPY --from=builder /opt/spack-environment /opt/spack-environment +# COPY --from=builder /opt/software /opt/software -# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it -COPY --from=builder /opt/views /opt/views +# # paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it +# COPY --from=builder /opt/views /opt/views RUN { \ echo '#!/bin/sh' \ diff --git a/docker/x86_64/spack.yaml b/docker/x86_64/spack.yaml index 9e0714f5c..382ee726c 100644 --- a/docker/x86_64/spack.yaml +++ b/docker/x86_64/spack.yaml @@ -1,6 +1,6 @@ spack: specs: - - cmake@3.29.6 + - cmake@3.30.2 - feq-parse@2.2.2 - openmpi@5.0.2 - hdf5@1.14.3 +fortran +mpi @@ -13,7 +13,7 @@ spack: # Sets the base images for the stages where Spack builds the # software or where the software gets installed after being built.. images: - os: "rockylinux:8" + os: "ubuntu:22.04 " spack: develop # Labels for the image diff --git a/docs/GettingStarted/docker.md b/docs/GettingStarted/docker.md new file mode 100644 index 000000000..5469e794e --- /dev/null +++ b/docs/GettingStarted/docker.md @@ -0,0 +1,30 @@ +# SELF Docker Images + +## Fluid Numerics Artifact Registry +Fluid Numerics maintains a registry of Docker images on Google Cloud. We provide access to this registry through a subscription to the [Fluid Numerics Higher Order Methods Lab (homlab)](https://www.fluidnumerics.com/shop/p/higher-order-methods-lab). Once you have a [homlab subscription](https://www.fluidnumerics.com/shop/p/higher-order-methods-lab), you will have the ability to pull Docker images that we maintain and test regularly. + +When you sign up for the subscription you will need a Gmail, Google Workspace, or Cloud Identity account that you use for Google Cloud. + +## Build your own images +The SELF repository comes with docker recipes for CPU-only, ROCm, and CUDA platforms. Each recipe is organized under the `docker/` subdirectory: + +* `docker/x86_64` - CPU only, MPI enabled, multithreaded +* `docker/x86_64_rocm` - MPI+HIP enabled, multithreaded +* `docker/x86_64_cuda` - MPI+CUDA enabled, multithreaded + +Each subdirectory contains a `spack.yaml` and `Dockerfile`. The `spack.yaml` file is used to generate the Dockerfile using `spack containerize`. The `spack.yaml` files are retained for development purposes and are often not used by end-users. + +### CPU-only platforms +To build a Docker image for CPU only platforms : + +1. Clone the SELF repository + +```shell +git clone https://github.com/fluidnumerics/self ~/self/ +cd ~/self/ +``` + +2. Build the image with `docker build`. This process installs all of SELF's dependencies and SELF and usually takes about 30 minutes to complete. +``` +docker build -f docker/x86_64/Dockerfile -t self-x86_64:latest . +``` \ No newline at end of file From 3fbb13d83bd83d519c5685e011a56e686592d703 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 15 Nov 2024 15:01:54 -0500 Subject: [PATCH 6/7] Disable tests during build; set nthreads=4 --- docker/x86_64/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/x86_64/Dockerfile b/docker/x86_64/Dockerfile index 810ee1822..b56f2b4dc 100644 --- a/docker/x86_64/Dockerfile +++ b/docker/x86_64/Dockerfile @@ -27,6 +27,9 @@ RUN spack env activate -d /opt/spack-environment &&\ cmake -DCMAKE_BUILD_TYPE=release \ -DSELF_ENABLE_MULTITHREADING=ON \ -DCMAKE_INSTALL_PREFIX=/opt/views/view \ + -DSELF_ENABLE_TESTS=OFF \ + -DSELF_ENABLE_EXAMPLES=ON \ + -DSELF_MULTITHREADING_NTHREADS=4 \ ../ && \ make VERBOSE=1 && \ make install From 9f434093bec056766aac4a24aea5ccbae5ceebe2 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 15 Nov 2024 15:28:36 -0500 Subject: [PATCH 7/7] Add docker & singularity documentation for using the registry --- docs/GettingStarted/docker.md | 103 +++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/docs/GettingStarted/docker.md b/docs/GettingStarted/docker.md index 5469e794e..494658756 100644 --- a/docs/GettingStarted/docker.md +++ b/docs/GettingStarted/docker.md @@ -1,9 +1,108 @@ # SELF Docker Images ## Fluid Numerics Artifact Registry -Fluid Numerics maintains a registry of Docker images on Google Cloud. We provide access to this registry through a subscription to the [Fluid Numerics Higher Order Methods Lab (homlab)](https://www.fluidnumerics.com/shop/p/higher-order-methods-lab). Once you have a [homlab subscription](https://www.fluidnumerics.com/shop/p/higher-order-methods-lab), you will have the ability to pull Docker images that we maintain and test regularly. +Fluid Numerics maintains a registry of Docker images on Google Cloud. We provide access to this registry through a subscription to the [Fluid Numerics Higher Order Methods Lab (homlab)](https://www.fluidnumerics.com/shop/p/higher-order-methods-lab). Once you have a [homlab subscription](https://www.fluidnumerics.com/shop/p/higher-order-methods-lab), or if you are a [collaborator](https://opencollective.com/opensource-fluidnumerics/projects/spectral-element-library-in-fo) you will have the ability to pull Docker images that we maintain and test regularly. + +### Available Images +| Image | compiler | MPI flavor | GPU Software | Target GPU | Target CPU | +| --------------- | -------- | ------------- | --- | ----| ------ | +|**`self-x86_64`**| gfortran | openmpi@5.0.2 | N/A | N/A | x86_64 | +|**`self-x86_64-gfx90a_rocm6.2.1`**| gfortran | openmpi@5.0.2 | rocm@6.0.2 | gfx90a (MI200) | x86_64 | +|**`self-x86_64-gfx942_rocm6.2.1`**| gfortran | openmpi@5.0.2 | rocm@6.0.2 | gfx942 (MI300) | x86_64 | +|**`self-x86_64-sm72_cuda12.1`**| gfortran | openmpi@5.0.2 | cuda@12.1 | sm72 (V100) | x86_64 | +|**`self-x86_64-sm90_cuda12.1`**| gfortran | openmpi@5.0.2 | cuda@12.1 | sm90 (H100) | x86_64 | + + +This guide provides instructions for pulling our Docker images hosted on Google Cloud Artifact Registry using **Docker** and **Singularity/Apptainer**. + + +### **Prerequisites** + +#### General Requirements +- Ensure you have access credentials for the Google Cloud project hosting the Docker image. + +#### Docker-Specific Requirements +- [Docker](https://www.docker.com/) installed on your system (version 20.10 or later recommended). +- A Google Cloud service account or personal account with permissions to access the Artifact Registry. + +#### Singularity/Apptainer-Specific Requirements +- [Singularity](https://sylabs.io/singularity/) or [Apptainer](https://apptainer.org/) installed on your system (version 3.8 or later recommended). +- Docker CLI available to pull images before converting them for use with Singularity/Apptainer. + + +### Pulling the Docker Image with Docker + +1. **Authenticate with Google Cloud Artifact Registry** + Run the following command to authenticate Docker with Google Cloud: + ```bash + gcloud auth configure-docker us-docker.pkg.dev + ``` + This configures Docker to use your Google Cloud credentials for accessing private images. + +2. **Pull the Docker Image** + Use the `docker pull` command to fetch the image: + ```bash + docker pull us-docker.pkg.dev/fluidnumerics-research/self/self-x86_64:latest + ``` + Replace `latest` with the desired tag if applicable. + +3. **Verify the Image** + Confirm the image has been pulled successfully by listing it: + ```bash + docker images + ``` + + +### Pulling and Using the Image with Singularity/Apptainer + +#### Option 1: Direct Pull Using `singularity pull` + +Singularity/Apptainer can directly pull the image and convert it into a `.sif` file. + +1. **Pull the Image** + Use the `singularity pull` or `apptainer pull` command: + ```bash + singularity pull docker://us-docker.pkg.dev/fluidnumerics-research/self/self-x86_64:latest + ``` + This will fetch the image and save it as `self-x86_64_latest.sif` in your current directory. + +2. **Verify the SIF File** + Check that the file was created: + ```bash + ls -lh self-x86_64_latest.sif + ``` + +3. **Run the Image** + Execute commands using the Singularity container: + ```bash + singularity exec self-x86_64_latest.sif + ``` + +#### Option 2: Pull with Docker and Convert Locally + +If you prefer to use Docker first and then convert the image for Singularity/Apptainer: + +1. **Pull the Docker Image** + Follow the Docker instructions above to pull the image. + +2. **Save the Docker Image as a `.tar` File** + Export the Docker image to a tarball: + ```bash + docker save us-docker.pkg.dev/fluidnumerics-research/self/self-x86_64:latest -o self-x86_64.tar + ``` + +3. **Convert to a Singularity SIF File** + Use `singularity build` or `apptainer build` to create a SIF file: + ```bash + singularity build self-x86_64.sif docker-archive://self-x86_64.tar + ``` + +4. **Run the Image** + Use the `singularity exec` command: + ```bash + singularity exec self-x86_64.sif + ``` -When you sign up for the subscription you will need a Gmail, Google Workspace, or Cloud Identity account that you use for Google Cloud. ## Build your own images The SELF repository comes with docker recipes for CPU-only, ROCm, and CUDA platforms. Each recipe is organized under the `docker/` subdirectory: