-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
236 additions
and
91 deletions.
There are no files selected for viewing
This file contains 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,60 @@ | ||
name: Container | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
IMAGE_NAME: pynucleus | ||
IMAGE_TAGS: latest ${{ github.sha }} | ||
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | ||
REGISTRY_USER: ${{ github.actor }} | ||
REGISTRY_PASSWORD: ${{ github.token }} | ||
|
||
jobs: | ||
|
||
container: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 300 | ||
|
||
steps: | ||
- name: Check out | ||
if: always() | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
ignore: 'DL3008,DL3013' | ||
|
||
- name: Build Image | ||
id: build_image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: ${{ env.IMAGE_TAGS }} | ||
containerfiles: | | ||
./Dockerfile | ||
- name: Run tests | ||
run: | | ||
podman run -e MPIEXEC_FLAGS="--allow-run-as-root --oversubscribe" --rm ${{ steps.build_image.outputs.image }}:${{ github.sha }} python3 -m pytest --junit-xml=test-results.xml tests/ | ||
- name: Push To GHCR | ||
uses: redhat-actions/push-to-registry@v2 | ||
id: push | ||
with: | ||
image: ${{ steps.build_image.outputs.image }} | ||
tags: ${{ steps.build_image.outputs.tags }} | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ env.REGISTRY_USER }} | ||
password: ${{ env.REGISTRY_PASSWORD }} | ||
extra-args: | | ||
--disable-content-trust | ||
- name: Echo outputs | ||
run: | | ||
echo "${{ toJSON(steps.push.outputs) }}" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,44 @@ | ||
version: 3 | ||
|
||
services: | ||
|
||
# Launch with: | ||
# docker compose run --profile interactive pynucleus | ||
pynucleus: | ||
image: ghcr.io/sandialabs/pynucleus:latest | ||
build: . | ||
environment: | ||
# host display server | ||
- DISPLAY=${DISPLAY} | ||
# expose host proxies | ||
- http_proxy=${http_proxy} | ||
- https_proxy=${https_proxy} | ||
- HTTP_PROXY=${HTTP_PROXY} | ||
- HTTPS_PROXY=${HTTPS_PROXY} | ||
volumes: | ||
# The current directory on host gets mapped to /pynucleus/user in the container | ||
- $PWD:/pynucleus/user | ||
# map files to container to allow GUI windows | ||
- /tmp/.X11-unix:/tmp/.X11-unix | ||
- $XAUTHORITY:/root/.Xauthority | ||
network_mode: host | ||
|
||
# Launch with: | ||
# docker compose up | ||
# Then open localhost:8888 in your browser | ||
pynucleus-jupyter: | ||
image: ghcr.io/sandialabs/pynucleus:latest | ||
build: . | ||
command: jupyter notebook --port=8888 --no-browser --ip=0.0.0.0 --allow-root --NotebookApp.token='' --NotebookApp.password='' --notebook-dir=/pynucleus/user --KernelSpecManager.ensure_native_kernel=False --KernelSpecManager.allowed_kernelspecs=pynucleus | ||
environment: | ||
# expose host proxies | ||
- http_proxy=${http_proxy} | ||
- https_proxy=${https_proxy} | ||
- HTTP_PROXY=${HTTP_PROXY} | ||
- HTTPS_PROXY=${HTTPS_PROXY} | ||
volumes: | ||
# The current directory on host gets mapped to /pynucleus/user in the container | ||
- $PWD/notebooks:/pynucleus/user | ||
ports: | ||
# Expose a Jupyter notebook server from the container | ||
- 8889:8888 |
Oops, something went wrong.