Skip to content
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

build: 👷 Update release of docker image #937

Merged
merged 1 commit into from
Aug 1, 2023
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
27 changes: 25 additions & 2 deletions .github/workflows/release-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ jobs:
matrix:
docker-platform:
- platform: linux/amd64
name: x86_64
name: amd64
- platform: linux/arm64
name: arm64
max-parallel: 2
max-parallel: 1
if: github.repository == 'Anselmoo/spectrafit'
runs-on: ubuntu-latest

permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -94,3 +102,18 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.docker-platform.platform }}

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
74 changes: 55 additions & 19 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,34 +180,70 @@ available plugins are:
[Jupyter-Scipy-Image][5] and contains the `SpectraFit` package and
the [Jupyter-Notebook][6] interface.

The Docker-Image can be installed and used via:
The Docker-Image can be installed for both **amd64** aka **x86_64** or
**arm64** and used via:

```terminal
docker pull ghcr.io/anselmoo/spectrafit:latest
docker run -it -p 8888:8888 spectrafit:latest
```
=== "amd64 aka x86_64"

or just via:
```terminal
docker pull ghcr.io/anselmoo/spectrafit-amd64:latest
docker run -it -p 8888:8888 spectrafit-amd64:latest
```

```terminal
docker run -it -p 8888:8888 ghcr.io/anselmoo/spectrafit:latest
```
or just via:

```terminal
docker run -it -p 8888:8888 ghcr.io/anselmoo/spectrafit-amd64:latest
```

![Docker-Image](https://github.com/Anselmoo/spectrafit/blob/9094da4472db889d50652d4ded870d42dd0ed559/docs/images/docker.png?raw=true)

To include the _home directory_ of the host system, the following command can
be used:
![Docker-Image](https://github.com/Anselmoo/spectrafit/blob/9094da4472db889d50652d4ded870d42dd0ed559/docs/images/docker.png?raw=true)

```terminal
docker run -it -p 8888:8888 -v $HOME:/home/user/work spectrafit:latest
```
To include the _home directory_ of the host system, the following command can
be used:

or via:
```terminal
docker run -it -p 8888:8888 -v $HOME:/home/user/work spectrafit-amd64:latest
```

```terminal
docker run -it -p 8888:8888 -v $HOME:/home/user/work ghcr.io/anselmoo/spectrafit:latest
```
or via:

```terminal
docker run -it -p 8888:8888 -v $HOME:/home/user/work ghcr.io/anselmoo/spectrafit-amd64:latest
```

see also: https://github.com/Anselmoo/spectrafit/pkgs/container/spectrafit-amd64

=== "arm64"

```terminal
docker pull ghcr.io/anselmoo/spectrafit-arm64:latest
docker run -it -p 8888:8888 spectrafit-arm64:latest
```

or just via:

```terminal
docker run -it -p 8888:8888 ghcr.io/anselmoo/spectrafit-arm64:latest
```


![Docker-Image](https://github.com/Anselmoo/spectrafit/blob/9094da4472db889d50652d4ded870d42dd0ed559/docs/images/docker.png?raw=true)

To include the _home directory_ of the host system, the following command can
be used:

```terminal
docker run -it -p 8888:8888 -v $HOME:/home/user/work spectrafit-arm64:latest
```

or via:

```terminal
docker run -it -p 8888:8888 -v $HOME:/home/user/work ghcr.io/anselmoo/spectrafit-arm64:latest
```

see also: https://github.com/Anselmoo/spectrafit/pkgs/container/spectrafit-arm64

[1]: https://github.com/pypa/pipx
[2]: https://conda.io/docs/
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,17 @@ Open the `Jupyter Notebook` and run the following code:
spectrafit-jupyter
```

or via Docker Image:
or via Docker Image for `<cpu>` with `amd64` and `arm64`:

```terminal
docker pull ghcr.io/anselmoo/spectrafit:latest
docker run -it -p 8888:8888 spectrafit:latest
docker pull ghcr.io/anselmoo/spectrafit-<cpu>:latest
docker run -it -p 8888:8888 spectrafit-<cpu>:latest
```

or just:

```terminal
docker run -p 8888:8888 ghcr.io/anselmoo/spectrafit:latest
docker run -p 8888:8888 ghcr.io/anselmoo/spectrafit-<cpu>:latest
```

Next define your initial model and the reference data:
Expand Down
20 changes: 10 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "SpectraFit"
version = "0.22.2"
version = "0.22.3"
description = "Fast fitting of 2D- and 3D-Spectra with established routines"
readme = "README.md"
authors = ["Anselm Hahn <anselm.hahn@gmail.com>"]
Expand Down
2 changes: 1 addition & 1 deletion spectrafit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""SpectraFit, fast command line tool for fitting data."""
__version__ = "0.22.2"
__version__ = "0.22.3"
Loading