-
Notifications
You must be signed in to change notification settings - Fork 4
Apptainer support #1
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| Bootstrap: docker | ||
| From: ubuntu:22.04 | ||
|
|
||
| %post | ||
|
|
||
| # Install dependencies | ||
| apt-get -y update | ||
| apt-get install -y software-properties-common | ||
| apt-get upgrade -y | ||
| apt-get install -y build-essential python3 python3-pip git wget clang lld libzstd-dev libomp-dev | ||
| python3 -m pip install --upgrade pip | ||
| python3 -m pip install 'cmake==3.22' | ||
|
|
||
| # Add GitHub trusted host | ||
| mkdir -p ~/.ssh | ||
| touch ~/.ssh/known_hosts | ||
| ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
| chmod 700 ~/.ssh | ||
| chmod 644 ~/.ssh/known_hosts | ||
|
|
||
| # Install ROCm | ||
| mkdir --parents --mode=0755 /etc/apt/keyrings | ||
| wget --no-check-certificate https://repo.radeon.com/rocm/rocm.gpg.key -O - | \ | ||
| gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null | ||
|
|
||
| echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3.2 jammy main" \ | ||
| | tee --append /etc/apt/sources.list.d/rocm.list | ||
|
|
||
| printf "Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600\n" | tee /etc/apt/preferences.d/rocm-pin-600 | ||
|
|
||
| apt-get -y update | ||
| ROCM_VERSION=$(apt-cache search rocm-dev[0-9] | awk '{print $1}' | sed 's/rocm-dev//g') | ||
| apt-get install -y rocm-dev6.3.2 rocm-llvm-dev6.3.2 rocm-hip-runtime-dev6.3.2 rocm-smi-lib6.3.2 rocminfo6.3.2 | ||
| export PATH=/opt/rocm/bin:$PATH | ||
| export LD_LIBRARY_PATH=/opt/rocm/lib:$LD_LIBRARY_PATH | ||
| export ROCM_PATH=/opt/rocm | ||
|
|
||
| # Install logduration | ||
| export SSH_AUTH_SOCK={{ SSH_AUTH_SOCK }} | ||
| cd /root | ||
| git clone -v git@github.com:AARInternal/logduration.git | ||
| cd logduration | ||
| git submodule update --init --recursive | ||
| mkdir -p build | ||
| cmake -DCMAKE_INSTALL_PREFIX=/opt/logduration -DCMAKE_PREFIX_PATH=${ROCM_PATH} -DLLVM_INSTALL_DIR=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -S . -B build | ||
| cmake --build build --target install | ||
|
|
||
| # Install rocprof-compute | ||
| cd /root | ||
| git clone -v git@github.com:ROCm/rocprofiler-compute.git | ||
| cd rocprofiler-compute | ||
| export INSTALL_DIR=/opt/rocprofiler-compute | ||
| python3 -m pip install -t ${INSTALL_DIR}/python-libs -r requirements.txt | ||
| mkdir build | ||
| cd build | ||
| cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/3.0.0 \ | ||
| -DPYTHON_DEPS=${INSTALL_DIR}/python-libs \ | ||
| -DMOD_INSTALL_PATH=${INSTALL_DIR}/modulefiles/rocprofiler-compute .. | ||
| make install | ||
| export PATH=${INSTALL_DIR}/3.0.0/bin:$PATH | ||
|
|
||
| # Install guided-tuning (JBs tool) | ||
| cd /root | ||
| git clone -v git@github.com:AARInternal/guided-tuning.git | ||
| python3 -m pip install pandas duckdb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
|
|
||
| timestamp=$(date +"%Y%m%d_%H%M%S") | ||
|
|
||
| # Auto config SSH agent | ||
| if [ ! -S ~/.ssh/ssh_auth_sock ]; then | ||
| eval `ssh-agent` > /dev/null | ||
| ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock | ||
| fi | ||
| export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock | ||
| [ -f ~/.ssh/id_rsa ] && ssh-add ~/.ssh/id_rsa | ||
| [ -f ~/.ssh/id_ed25519 ] && ssh-add ~/.ssh/id_ed25519 | ||
|
|
||
| ssh_auth_sock_path=$(readlink -f "$SSH_AUTH_SOCK") | ||
| # Build the Singularity container | ||
| # --build-arg SSH_AUTH_SOCK=$SSH_AUTH_SOCK is used to pass the SSH agent socket to the container | ||
| # (advantage of this method is that the key is at no point copied to the container image.) | ||
| # If your SSH_AUTH_SOCK will not already bound to the container, and is available at /run/..., add `--bind /run` to the build command | ||
| apptainer build \ | ||
| --build-arg SSH_AUTH_SOCK=${ssh_auth_sock_path} \ | ||
| "maestro_${timestamp}.sif" maestro.def | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, but I've found scripts like this can inadvertently create duplicate ssh-agents. For my own usage, I use a script similar to this in my
~/.bashrc:This way, we're always re-using the same ssh-agent. Let me find a middle ground between both of these solutions and add it to the script