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

feat: promote beta release to production 1.0.0 #34

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ca0553c
feat: setup semantic release
plexoos Apr 23, 2024
51d0ebc
chore(release): 1.0.0-beta.1
semantic-release-bot Apr 26, 2024
3a12c6b
ci: update pull request workflow (#35)
plexoos Apr 26, 2024
1906009
ci: update pull request workflow (#36)
plexoos Apr 26, 2024
928acba
fix(eic-shell): switch to ghcr.io registry
plexoos Apr 26, 2024
105a4ba
fix: remove container after tests
plexoos Apr 26, 2024
941ab00
chore(release): 1.0.0-beta.2
semantic-release-bot Apr 26, 2024
2d6706a
feat: upgrade opticks (#39)
plexoos May 3, 2024
e7e3351
chore(release): 1.0.0-beta.3
semantic-release-bot May 3, 2024
13c5502
chore: rename repo to esi-shell (#44)
plexoos May 3, 2024
8138919
revert: restore removed pull of latest image for cache purposes (#47)
plexoos May 3, 2024
dcbdd92
chore: re-license with Apache License Version 2.0 (#46)
plexoos May 3, 2024
4338f7c
feat: update opticks (#42)
plexoos May 6, 2024
f8824f3
chore(release): 1.0.0-beta.4
semantic-release-bot May 6, 2024
3d2f837
feat: build gpu code dependent on OptiX, run opticks tests (#49)
plexoos May 7, 2024
c67557d
fix: pull external asset in release workflow (#51)
plexoos May 7, 2024
a566835
Revert "fix: pull external asset in release workflow (#51)"
plexoos May 7, 2024
a301bd2
Revert "feat: build gpu code dependent on OptiX, run opticks tests (#…
plexoos May 7, 2024
e45db58
chore(release): 1.0.0-beta.5
semantic-release-bot May 7, 2024
5f58b7b
feat: build gpu code dependent on OptiX, run opticks tests (#49) (#53)
plexoos May 7, 2024
91618f5
chore(release): 1.0.0-beta.6
semantic-release-bot May 7, 2024
55968d3
ci: combine build and test jobs in build-pull-request workflow (#54)
plexoos May 7, 2024
71e70c8
ci: use proper token to cleanup untagged packages
plexoos May 7, 2024
20c6f4b
test: add wrapper around opticks tests (#57)
plexoos May 8, 2024
752302c
Update readme instructions for running with docker (#56)
rahmans1 May 9, 2024
7a0e1f9
Add vim text editor to the container (#60)
rahmans1 May 9, 2024
e483587
ci: use appropriate token (#61)
plexoos May 10, 2024
33f5b06
fix: always pull updated image from registry (#62)
plexoos May 10, 2024
9d1789a
chore(release): 1.0.0-beta.7
semantic-release-bot May 10, 2024
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
47 changes: 18 additions & 29 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,34 @@ concurrency:
cancel-in-progress: true

jobs:
build-container:
runs-on: ubuntu-latest
build-test:
runs-on: [gpu]
steps:
- name: Define environment variables
run: |
echo REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo IMAGE_NAME=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo TAG=$(echo "PR-${{ github.event.pull_request.number }}") >> $GITHUB_ENV

- name: Set up docker
uses: docker/setup-buildx-action@v3

- name: Build container
uses: docker/build-push-action@v5
- name: Checkout code
uses: actions/checkout@v4
with:
tags: ghcr.io/${{ env.REPOSITORY }}:${{ env.TAG }}
outputs: type=docker,dest=/tmp/esi-opticks-${{ env.TAG }}.tar
submodules: true

- name: Save built image for test jobs
uses: actions/upload-artifact@v4
with:
name: esi-opticks-${{ env.TAG }}
path: /tmp/esi-opticks-${{ env.TAG }}.tar
- name: Copy external assets
run: cp /home/runner/NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh .

test-container:
runs-on: ubuntu-latest
needs: build-container
steps:
- name: Define environment variables
run: |
echo REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
echo TAG=$(echo "PR-${{ github.event.pull_request.number }}") >> $GITHUB_ENV
- name: Set up docker
uses: docker/setup-buildx-action@v3

- name: Download artifact
uses: actions/download-artifact@v4
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
name: esi-opticks-${{ env.TAG }}
path: /tmp
context: .
tags: ${{ env.IMAGE_NAME }}:${{ env.TAG }}
load: true
cache-from: ${{ env.IMAGE_NAME }}:latest
cache-to: type=inline

- name: Run tests
run: |
docker load --input /tmp/esi-opticks-${{ env.TAG }}.tar
docker run ghcr.io/${{ env.REPOSITORY }}:${{ env.TAG }} bash -l -c opticks-info
docker run --rm ${{ env.IMAGE_NAME }}:${{ env.TAG }} tests/test_opticks.sh
25 changes: 25 additions & 0 deletions .github/workflows/delete_untagged.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3

import argparse
import json
import requests
import types

parser = argparse.ArgumentParser()
parser.add_argument("token", help="GitHub token")
args = parser.parse_args()

domain = "api.github.com"
org = "BNLNPPS"
package_type = "container"
package_name = "esi-shell"

api_url = f"https://{domain}/orgs/{org}/packages/{package_type}/{package_name}/versions"

respjson = requests.get(api_url, auth=("token", args.token))
entries = json.loads(respjson.text, object_hook=lambda d: types.SimpleNamespace(**d))

for e in entries:
if not e.metadata.container.tags:
response = requests.delete(api_url + f"/{e.id}", auth=("token", args.token))
print("delete", e.id, e.html_url, e.name, response.url, response.status_code)
93 changes: 93 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Release

on:
push:
branches:
- main
- beta
- betatest

jobs:
build-test-release:
runs-on: [gpu]
steps:
- name: Define environment variables
run: echo IMAGE_NAME=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for Semantic Release to analyze all commits

- name: Copy external assets
run: cp /home/runner/NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh .

- name: Set up docker buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image locally
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ env.IMAGE_NAME }}:latest
pull: true
load: true
cache-from: ${{ env.IMAGE_NAME }}:latest
cache-to: type=inline

- name: Run tests
run: docker run --rm ${{ env.IMAGE_NAME }}:latest tests/test_opticks.sh

- name: Declare latest and push
run: docker push ${{ env.IMAGE_NAME }}:latest

- name: Create semantic release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout new release
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/checkout@v4
with:
ref: ${{ steps.semantic.outputs.new_release_git_tag }}

- name: Copy external assets
run: cp /home/runner/NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh .

- name: Build image for new release
if: steps.semantic.outputs.new_release_published == 'true'
uses: docker/build-push-action@v5
with:
context: .
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ steps.semantic.outputs.new_release_version }}
push: true
cache-from: ${{ env.IMAGE_NAME }}:latest
cache-to: type=inline

cleanup:
runs-on: ubuntu-latest
needs: build-test-release
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Delete untagged images
run: |
python -m pip install requests
.github/workflows/delete_untagged.py ${{ secrets.BNLNPPS_ESI_SHELL_PACKAGES_TOKEN }}
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "opticks"]
path = opticks
url = https://github.com/simoncblyth/opticks.git
url = https://bitbucket.org/simoncblyth/opticks.git
20 changes: 20 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See https://semantic-release.gitbook.io/semantic-release/usage/configuration
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- name: 'beta'
prerelease: true
- name: 'betatest'
prerelease: true
tagFormat: '${version}' # without this, the tag is prefixed with a 'v'
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"
- path: "@semantic-release/npm"
npmPublish: false
- path: "@semantic-release/git"
assets:
- "CHANGELOG.md"
- "package.json"
message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# [1.0.0-beta.7](https://github.com/BNLNPPS/esi-shell/compare/1.0.0-beta.6...1.0.0-beta.7) (2024-05-10)


### Bug Fixes

* always pull updated image from registry ([#62](https://github.com/BNLNPPS/esi-shell/issues/62)) ([33f5b06](https://github.com/BNLNPPS/esi-shell/commit/33f5b0614ecd4ce3918492c22a087aa395767932))

# [1.0.0-beta.6](https://github.com/BNLNPPS/esi-shell/compare/1.0.0-beta.5...1.0.0-beta.6) (2024-05-07)


### Features

* build gpu code dependent on OptiX, run opticks tests ([#49](https://github.com/BNLNPPS/esi-shell/issues/49)) ([#53](https://github.com/BNLNPPS/esi-shell/issues/53)) ([5f58b7b](https://github.com/BNLNPPS/esi-shell/commit/5f58b7be7d1893ba7247de5b95f43a7349aa4cf8)), closes [#50](https://github.com/BNLNPPS/esi-shell/issues/50)

# [1.0.0-beta.5](https://github.com/BNLNPPS/esi-shell/compare/1.0.0-beta.4...1.0.0-beta.5) (2024-05-07)


### Reverts

* Revert "feat: build gpu code dependent on OptiX, run opticks tests (#49)" ([a301bd2](https://github.com/BNLNPPS/esi-shell/commit/a301bd290c43476ef5fa674ce7cc52f326fa29e9)), closes [#49](https://github.com/BNLNPPS/esi-shell/issues/49)

# [1.0.0-beta.4](https://github.com/BNLNPPS/esi-shell/compare/1.0.0-beta.3...1.0.0-beta.4) (2024-05-06)


### Features

* update opticks ([#42](https://github.com/BNLNPPS/esi-shell/issues/42)) ([4338f7c](https://github.com/BNLNPPS/esi-shell/commit/4338f7c51bb92b643bfbef9cb32920d517f26395)), closes [#41](https://github.com/BNLNPPS/esi-shell/issues/41)


### Reverts

* restore removed pull of latest image for cache purposes ([#47](https://github.com/BNLNPPS/esi-shell/issues/47)) ([8138919](https://github.com/BNLNPPS/esi-shell/commit/8138919d14d20646535e0c80c1e1266c04e9543b))

# [1.0.0-beta.3](https://github.com/BNLNPPS/esi-opticks/compare/1.0.0-beta.2...1.0.0-beta.3) (2024-05-03)


### Features

* upgrade opticks ([#39](https://github.com/BNLNPPS/esi-opticks/issues/39)) ([2d6706a](https://github.com/BNLNPPS/esi-opticks/commit/2d6706a0ccf8bb79b55a538c1437464ab5462648))

# [1.0.0-beta.2](https://github.com/BNLNPPS/esi-opticks/compare/1.0.0-beta.1...1.0.0-beta.2) (2024-04-26)


### Bug Fixes

* **eic-shell:** switch to ghcr.io registry ([928acba](https://github.com/BNLNPPS/esi-opticks/commit/928acba495e3865e5d986e899de8993abcd63768))
* remove container after tests ([105a4ba](https://github.com/BNLNPPS/esi-opticks/commit/105a4ba3d2de5db92c96e451a40e5fcc50a96a4d))

# 1.0.0-beta.1 (2024-04-26)


### Bug Fixes

* **build:** keep build cache dir ([#21](https://github.com/BNLNPPS/esi-opticks/issues/21)) ([d81672d](https://github.com/BNLNPPS/esi-opticks/commit/d81672d8f4a08532e2719851320ee9e3112cb5a5))
* **esi-shell:** avoid building code (OptiX) on shell startup ([#23](https://github.com/BNLNPPS/esi-opticks/issues/23)) ([76320cf](https://github.com/BNLNPPS/esi-opticks/commit/76320cf6e8d43e37414d0469ae8f81c950f97231))
* **esi-shell:** drop support for singularity with GPU (for now) ([#22](https://github.com/BNLNPPS/esi-opticks/issues/22)) ([4cb9d19](https://github.com/BNLNPPS/esi-opticks/commit/4cb9d19c3180ac66aab8d58a4e615cd4e0e6567e))
* **esi-shell:** improve user experience ([#20](https://github.com/BNLNPPS/esi-opticks/issues/20)) ([0a464af](https://github.com/BNLNPPS/esi-opticks/commit/0a464af1dd9d01cedb98dd50b3f3681dbe73da22))
* **esi-shell:** support only linux ([#13](https://github.com/BNLNPPS/esi-opticks/issues/13)) ([6cfb154](https://github.com/BNLNPPS/esi-opticks/commit/6cfb154d82fe252089b10ef92db3a63707c2a60b))
* patch spack default modules.yaml ([#27](https://github.com/BNLNPPS/esi-opticks/issues/27)) ([23183af](https://github.com/BNLNPPS/esi-opticks/commit/23183af24648db3fdcdf0c5a9dc94385d9aa1b9c))
* set compute capability to 5.2 compatible with Quadro M4000 ([#1](https://github.com/BNLNPPS/esi-opticks/issues/1)) ([b1d7513](https://github.com/BNLNPPS/esi-opticks/commit/b1d751357c61ac3e18a94262536ca397d1fa54e7))
* simplify build workflow, leverage login scripts ([#8](https://github.com/BNLNPPS/esi-opticks/issues/8)) ([fd974b4](https://github.com/BNLNPPS/esi-opticks/commit/fd974b4c42dbcb8c1247cd262bafbf16e4eb071b))
* use correct gdml file ([c014536](https://github.com/BNLNPPS/esi-opticks/commit/c014536e4452a815bef61a2b03bfe456a898bb7d))


### Features

* add esi-shell ([#6](https://github.com/BNLNPPS/esi-opticks/issues/6)) ([fa859aa](https://github.com/BNLNPPS/esi-opticks/commit/fa859aa91496b27fb66d891ef78a28ec90b45c50))
* setup semantic release ([ca0553c](https://github.com/BNLNPPS/esi-opticks/commit/ca0553c24acb7da072314c1b4f31bc3a84d79460))
* upgrade opticks to main@b55f15bd ([#26](https://github.com/BNLNPPS/esi-opticks/issues/26)) ([946da36](https://github.com/BNLNPPS/esi-opticks/commit/946da36cdc7fe309c63a8547ca8aeeeb0551a313))
34 changes: 16 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN apt update \
libglm-dev libglfw3-dev libimgui-dev libglew-dev libglu1-mesa-dev \
libssl-dev python-is-python3 \
cuda-nvcc-11-8 libcurand-dev-11-8 \
libxinerama-dev libxcursor-dev libxi-dev \
nano vim \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -51,33 +53,29 @@ RUN echo "module use --append /opt/modules" >> /etc/profile.d/z10_load_spack_mod
RUN spack module tcl loads geant4 clhep boost cmake nlohmann-json >> /etc/profile.d/z10_load_spack_modules.sh
RUN rm -fr /opt/spack/share/spack/modules/$(spack arch)

# create a placeholder dir for NVIDIA OptiX
RUN mkdir -p /usr/local/optix

ENV ESI_DIR=/esi-opticks
ENV OPTICKS_HOME=$ESI_DIR/opticks
ENV ESI_DIR=/esi
ENV OPTIX_DIR=/usr/local/optix
ENV OPTICKS_HOME=${ESI_DIR}/opticks
ENV OPTICKS_PREFIX=/usr/local/opticks
ENV OPTICKS_CUDA_PREFIX=/usr/local/cuda
ENV OPTICKS_OPTIX_PREFIX=/usr/local/optix
ENV OPTICKS_OPTIX_PREFIX=${OPTIX_DIR}
ENV OPTICKS_COMPUTE_CAPABILITY=52
ENV PYTHONPATH=${OPTICKS_HOME}
ENV LD_LIBRARY_PATH=${OPTICKS_PREFIX}/lib/:$LD_LIBRARY_PATH

COPY epic $ESI_DIR/epic
COPY opticks $ESI_DIR/opticks
COPY .opticks $ESI_DIR/.opticks
WORKDIR $ESI_DIR

WORKDIR $OPTICKS_HOME
COPY epic epic
COPY opticks opticks
COPY .opticks .opticks
COPY tests tests
COPY NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh .

RUN mkdir -p $ESI_DIR
COPY <<-"EOF" /etc/profile.d/z20_opticks.sh
source $OPTICKS_HOME/opticks.bash
opticks-
EOF

RUN opticks-full-externals
RUN <<EOF
source om.bash
om-(){ echo "skip sourcing om.bash"; }
om-subs--all(){ deps=(okconf sysrap ana analytic bin CSG qudarap gdxml u4); printf '%s\n' "${deps[@]}"; }
opticks-full-make
EOF
RUN mkdir -p $OPTIX_DIR && ./NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh --skip-license --prefix=$OPTIX_DIR
RUN HOME=$ESI_DIR opticks-full
RUN rm -fr $OPTIX_DIR/* $ESI_DIR/NVIDIA-OptiX-SDK-7.6.0-linux64-x86_64.sh
Loading