Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ env:
ASTERA_REGISTRY: harbor.astera.sh
ASTERA_IMAGE_NAME: library/pixi-with-checkpoints
SKOPEO_IMAGE: quay.io/skopeo/stable@sha256:2bfc4bce3224a5940708fbaf7c161a2ef395ab272b568b3abfaf3ca48164b63d
# Update this only when the Astera overlay needs a newer EXT CLI; otherwise the
# repo variable can override it without changing this workflow.
EXT_CLI_IMAGE: ${{ vars.EXT_CLI_IMAGE || 'harbor.astera.sh/library/ext-cli:sha-724abde27fdfa15b23adb112d2e1dc83dd533a57' }}

DOCKER_METADATA_SHORT_SHA_LENGTH: 7

Expand Down Expand Up @@ -225,7 +222,6 @@ jobs:
labels: ${{ steps.astera-meta.outputs.labels }}
build-args: |
PIXI_WITH_CHECKPOINTS_IMAGE=${{ needs.public.outputs.image-ref }}
EXT_CLI_IMAGE=${{ env.EXT_CLI_IMAGE }}
cache-from: type=registry,ref=${{ env.ASTERA_REGISTRY }}/${{ env.ASTERA_IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.ASTERA_REGISTRY }}/${{ env.ASTERA_IMAGE_NAME }}:buildcache,mode=max
provenance: false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,5 @@ initial_dataset_40*/

# Reinclude
!src/sampleworks/data/protein_configs.csv

.idea
13 changes: 8 additions & 5 deletions Dockerfile.astera
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
# .

ARG PIXI_WITH_CHECKPOINTS_IMAGE
ARG EXT_CLI_IMAGE=harbor.astera.sh/library/ext-cli:sha-724abde27fdfa15b23adb112d2e1dc83dd533a57

FROM ${EXT_CLI_IMAGE} AS ext-cli

FROM ${PIXI_WITH_CHECKPOINTS_IMAGE} AS astera

ARG EXT_VERSION=v0.1.1

ENV DEBIAN_FRONTEND=noninteractive \
HOME=/home/dev \
XDG_CONFIG_HOME=/home/dev/.config \
Expand Down Expand Up @@ -57,9 +56,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
command -v "${cmd}" >/dev/null 2>&1 || exit 1; \
done

COPY --from=ext-cli /ext /usr/local/bin/ext
COPY docker/astera/ /usr/local/share/sampleworks/astera/

RUN chmod 0755 /usr/local/bin/ext
RUN install -m 0644 \
/usr/local/share/sampleworks/astera/sampleworks-ext-shell.sh \
/etc/profile.d/sampleworks-ext-shell.sh \
&& EXT_VERSION="${EXT_VERSION}" bash /usr/local/share/sampleworks/astera/install-ext.sh \
&& bash /usr/local/share/sampleworks/astera/install-ext-shell-hooks.sh

WORKDIR /home/dev

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ CI configuration variables:
| `SAMPLEWORKS_CHECKPOINTS_SOURCE_IMAGE` | Optional private/source checkpoint image that CI mirrors to Docker Hub; defaults to the current digest-pinned Harbor image |
| `SAMPLEWORKS_CHECKPOINTS_DOCKERHUB_IMAGE` | Optional public Docker Hub checkpoint mirror destination tag; defaults to `docker.io/diffuseproject/sampleworks-checkpoints:latest` |
| `SAMPLEWORKS_CUDA_BASE_IMAGE` | Optional digest-pinned CUDA base override |
| `EXT_CLI_IMAGE` | Optional EXT CLI image override for the Astera overlay |

Build the public image locally:

Expand Down
2 changes: 2 additions & 0 deletions docker/astera/ext-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[process_trace]
tracer = "ebpf"
18 changes: 18 additions & 0 deletions docker/astera/install-ext-shell-hooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

profile_script="/etc/profile.d/sampleworks-ext-shell.sh"
profile_comment="# Sampleworks: enter ext when ACTL sets EXT_SHELL=1."
profile_line="[ -r ${profile_script} ] && . ${profile_script}"

touch /root/.bashrc /home/dev/.bashrc

for profile_file in /etc/bash.bashrc /root/.bashrc /home/dev/.bashrc /etc/zsh/zshrc /etc/zsh/zprofile; do
if [ ! -e "${profile_file}" ]; then
continue
fi
if grep -Fqs "${profile_line}" "${profile_file}"; then
continue
fi
printf '\n%s\n%s\n' "${profile_comment}" "${profile_line}" >> "${profile_file}"
done
11 changes: 11 additions & 0 deletions docker/astera/install-ext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

EXT_VERSION="${EXT_VERSION:-v0.1.1}"
EXT_INSTALL_DIR="${EXT_INSTALL_DIR:-/usr/local/bin}"

curl -fsSL https://extshell.org/install.sh | bash -s -- --version "${EXT_VERSION}" --dir "${EXT_INSTALL_DIR}"
install -d -m 0755 /home/dev/.local/share/ext
install -m 0644 /usr/local/share/sampleworks/astera/ext-config.toml /home/dev/.local/share/ext/config.toml
command -v ext >/dev/null 2>&1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks that ext is in path after install.
Failing the build if it is not

ext --help >/dev/null
39 changes: 39 additions & 0 deletions docker/astera/sampleworks-ext-shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Enter ext only when ACTL sets EXT_SHELL=1.
[ "${EXT_SHELL:-}" = "1" ] || return 0 2>/dev/null || exit 0

case "$-" in
*i*) ;;
*) return 0 2>/dev/null || exit 0 ;;
esac

[ -t 0 ] || return 0 2>/dev/null || exit 0
Comment thread
marcuscollins marked this conversation as resolved.
[ -t 1 ] || return 0 2>/dev/null || exit 0
[ -z "${SAMPLEWORKS_EXT_SHELL_ATTEMPTED:-}" ] || return 0 2>/dev/null || exit 0
[ -z "${EXT_SHELL_ACTIVE:-}" ] || return 0 2>/dev/null || exit 0
[ -z "${BASH_EXECUTION_STRING:-}" ] || return 0 2>/dev/null || exit 0
[ -z "${ZSH_EXECUTION_STRING:-}" ] || return 0 2>/dev/null || exit 0
command -v ext >/dev/null 2>&1 || return 0 2>/dev/null || exit 0

__sampleworks_ext_config_template="/usr/local/share/sampleworks/astera/ext-config.toml"
__sampleworks_ext_data_home="${XDG_DATA_HOME:-${HOME:-/home/dev}/.local/share}"
__sampleworks_ext_config_dir="${__sampleworks_ext_data_home}/ext"
__sampleworks_ext_config="${__sampleworks_ext_config_dir}/config.toml"
mkdir -p "${__sampleworks_ext_config_dir}" 2>/dev/null || true
if [ ! -e "${__sampleworks_ext_config}" ] && [ -r "${__sampleworks_ext_config_template}" ]; then
cp "${__sampleworks_ext_config_template}" "${__sampleworks_ext_config}" 2>/dev/null || true
Comment thread
marcuscollins marked this conversation as resolved.
fi
unset __sampleworks_ext_config_template __sampleworks_ext_data_home
unset __sampleworks_ext_config_dir __sampleworks_ext_config

__sampleworks_ext_inner_shell=""
if [ -n "${BASH_VERSION:-}" ]; then
__sampleworks_ext_inner_shell="bash"
elif [ -n "${ZSH_VERSION:-}" ]; then
__sampleworks_ext_inner_shell="zsh"
fi

if [ -n "${__sampleworks_ext_inner_shell}" ]; then
export SAMPLEWORKS_EXT_SHELL_ATTEMPTED=1
exec ext shell -shell "${__sampleworks_ext_inner_shell}"
fi
unset __sampleworks_ext_inner_shell
Loading