-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge in HYP/hypernetx from release/2.3.3 to master * commit 'c9d9b94ba2b79c8377716ab51d22716a0812dedc': bump: version 2.3.2 → 2.3.3 Update README, documentation Add Docker build and publish to GitHub CI Fix Dockerfile Update Dockerfile Allow image in README to show on both PyPi and GitHub Add docker support Fix readme
- Loading branch information
Showing
7 changed files
with
301 additions
and
58 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
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,68 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# GitHub recommends pinning actions to a commit SHA. | ||
# To get a newer version, you will need to update the SHA. | ||
# You can also reference a tag or branch, but the action may change without warning. | ||
|
||
# This Workflow is based on GitHub's documentation at https://docs.github.com/en/actions/publishing-packages/publishing-docker-images | ||
name: Publish Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
workflow_dispatch: | ||
inputs: | ||
triggeredBy: | ||
description: 'Name of team member who is manually triggering this workflow' | ||
required: true | ||
|
||
jobs: | ||
|
||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- run: | | ||
echo "This workflow was triggered by: $TRIGGER_PERSON" | ||
env: | ||
TRIGGER_PERSON: ${{ inputs.triggeredBy }} | ||
IMAGE_NAME: hypernetx/hypernetx:latest | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | ||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
tags: ${{ env.IMAGE_NAME }} | ||
push: true | ||
|
||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: hypernetx/hypernetx | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
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 |
---|---|---|
|
@@ -36,7 +36,8 @@ jobs: | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | ||
- run: echo "Building wheel from branch ${{ github.ref_name }}" | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build and publish distribution 📦 to Test PyPI | ||
uses: JRubics/[email protected] | ||
|
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,30 @@ | ||
# This Dockerfile uses multistage-build to copy only the tutorial notebooks into the image | ||
# See https://stackoverflow.com/questions/49939960/docker-copy-files-using-glob-pattern | ||
|
||
# Stage 1: Copy all tutorial folders into first stage | ||
FROM quay.io/jupyter/base-notebook:python-3.11 AS builder | ||
|
||
WORKDIR /source | ||
|
||
COPY tutorials/basic . | ||
COPY tutorials/advanced . | ||
COPY tutorials/widget . | ||
|
||
# Stage 2: Copy only the Jupyter Notebooks defined in first stage (i.e. builder) | ||
FROM quay.io/jupyter/base-notebook:python-3.11 | ||
|
||
# Use Jupyter Notebook as the Frontend (default is Jupyter Lab) | ||
# See https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html#choosing-jupyter-frontend | ||
ENV DOCKER_STACKS_JUPYTER_CMD=notebook | ||
|
||
# Only copy the Jupyter notebooks | ||
# notebooks will be copied into '/home/jovyan' in the container | ||
COPY --from=builder /source/Basic* ./ | ||
COPY --from=builder /source/Advanced* ./ | ||
COPY --from=builder /source/Demo* ./ | ||
|
||
# Install the latest versions of HyperNetX and HNXWidget from PyPi | ||
RUN pip install --no-cache-dir hypernetx hnxwidget | ||
|
||
# When starting the Jupyter server, do not require a token when accessing URL: http://localhost:8888/tree | ||
ENTRYPOINT ["start-notebook.py", "--IdentityProvider.token=''"] |
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,11 @@ | ||
version: '3' | ||
|
||
services: | ||
hypernetx: | ||
image: hypernetx/hypernetx:latest | ||
ports: | ||
- "8888:8888" | ||
tty: true | ||
stdin_open: true | ||
volumes: | ||
- "${PWD}:/home/jovyan/work" |
Oops, something went wrong.