Skip to content

Commit

Permalink
v0.2.5 - Update packages, multi-stage build with standard and buildx,…
Browse files Browse the repository at this point in the history
… ci / tests
  • Loading branch information
pranavmishra90 authored Aug 28, 2024
2 parents 694cf6f + 38905c2 commit e9f1989
Show file tree
Hide file tree
Showing 103 changed files with 60,179 additions and 4,213 deletions.
1 change: 1 addition & 0 deletions .datalad/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config annex.largefiles=nothing
2 changes: 2 additions & 0 deletions .datalad/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[datalad "dataset"]
id = 94d1fb8d-6eb8-4e5f-993a-3af894400e9e
8 changes: 6 additions & 2 deletions .devcontainer/devcontainer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
"source=${localWorkspaceFolder},target=/home/coder/work,type=bind,consistency=cached"
],
"updateRemoteUserUID": true,
"runArgs": ["--gpus", "all"],
"forwardPorts": [3334],
"runArgs": ["--gpus", 0],
"forwardPorts": [3334, 8888],
"postCreateCommand": ["/bin/bash"],
"containerEnv": {
"ENV_NAME": "facsimilab"
},
"shutdownAction": "none",
"customizations": {
"vscode": {
"extensions": [
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* annex.backend=MD5E
**/.git* annex.largefiles=nothing
* annex.largefiles=nothing
74 changes: 74 additions & 0 deletions .gitea/workflows/bleeding-edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bleeding Edge (Gitea)

on:
push:
branches:
- gitea
- develop
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build-test-and-push:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
clean: false
submodules: true

- name: Read the image version
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./docker/image_version.txt


- name: Matrix Message - Starting Build
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "Completed FacsimiLab image build for tag ${{ steps.package.outputs.content }}"
server: "matrix.drpranavmishra.com"

- name: Build Docker images
run: bash docker/build-all.sh

- name: Matrix Message - Completed Build
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "Completed FacsimiLab image build for tag ${{ steps.package.outputs.content }}"
server: "matrix.drpranavmishra.com"


- name: Commit changes to git (docker image metadata)
uses: devops-infra/action-commit-push@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
# add_timestamp: false
commit_prefix: "ci(docker): "
commit_message: "Docker images built and pushed [GH Action]"
force: false
# target_branch:

- name: Write to workflow job summary
run: |
build_version=$(cat docker/image_version.txt)
builder_header="# $build_version "
echo "$builder_header" > testing/results/job_summary.md
cat testing/results/job_summary.md >> $GITHUB_STEP_SUMMARY
- name: Matrix Message - Completed GitHub Action
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "# Gitea: Completed FacsimiLab build github action for tag ${{ steps.package.outputs.content }}"
server: "matrix.drpranavmishra.com"
31 changes: 31 additions & 0 deletions .gitea/workflows/dev-test-full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Dev Image of FacsimiLab-Full

on:
push:
paths:
- "docker/facsimilab-conda-lock.yml"
workflow_dispatch:
jobs:
full-image-devevelopment:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build Docker images
run: bash docker/dev-test-full.sh

- name: Run Facsmilab-Full:Dev container and execute script
run: |
docker run --rm -v $(pwd):/home/coder/work --gpus 0 pranavmishra90/facsimilab-full:dev /opt/conda/envs/facsimilab/bin/python testing/full_image.py >> testing/results/full-image.txt
- name: Push Docker images
run: docker push pranavmishra90/facsimilab-full:dev

- name: Write to workflow job summary
run: |
build_version=$(cat docker/image_version.txt)
builder_header="# $build_version - Development Image"
echo "$builder_header" > testing/results/job_summary.md
cat testing/results/full-image.txt >> testing/results/job_summary.md
cat testing/results/job_summary.md >> $GITHUB_STEP_SUMMARY
97 changes: 97 additions & 0 deletions .gitea/workflows/python-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Check Python Packages

on:
# push:
# branches:
# - gitea
# - develop
# - main
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build-test-and-push:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Read the image version
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./docker/image_version.txt

- name: Workspace variable
run: echo "$GITHUB_WORKSPACE"

- name: List workspace
run: |
echo "Workspace ${{ github.workspace }}"
echo "PWD: $(pwd)"
find /workspace -type d -name '.git' -prune -o -type f -print
- name: Pull Docker image
run: |
echo "Pulling image pranavmishra90/facsimilab-full:${{ steps.package.outputs.content }}"
docker pull pranavmishra90/facsimilab-full:${{ steps.package.outputs.content }}
- name: List contents of main image
run: |
docker run --rm --user 0:0 --volumes-from=${{ env.JOB_CONTAINER_NAME }} -v $(pwd):/home/coder/work -e ENV_NAME=base pranavmishra90/facsimilab-main:dev cp -r ${{ github.workspace }} /home/coder/work && find /home/coder -type d -name '.git' -prune -o -type f -print
# - name: Main Image
# run: |
# docker run --rm -v $(pwd):/home/coder/work -e ENV_NAME=base pranavmishra90/facsimilab-main:dev /opt/conda/bin/python /home/coder/work/testing/main_image.py | tee output.txt


# - name: Full Image
# run: |
# docker run --rm -v $(pwd):/home/coder/work -e ENV_NAME=facsimilab pranavmishra90/facsimilab-full:dev /opt/conda/envs/facsimilab/bin/python /home/coder/work/testing/full_image.py | tee output.txt

# - name: Main Image
# uses: addnab/docker-run-action@v3
# env:
# WORKSPACE_DIR: ${{ github.workspace }}
# GITHUB_WORKSPACE: ${{ github.workspace }}
# with:
# image: pranavmishra90/facsimilab-main:${{ steps.package.outputs.content }}
# options: --rm --user 1000:1000 --volumes-from=${{ env.JOB_CONTAINER_NAME }} --entrypoint ${{ github.workspace }}
# run: |
# cp -r ${{ github.workspace }} /home/coder/work
# cd ${{ github.workspace }} && pwd && ls -lahgR .
# echo "----------------------------------------------------"
# cd /home/coder/work/facsimilab-platform && pwd && ls -lahgR .
# /opt/conda/bin/python ${{ github.workspace }}/testing/main_image.py > testing/results/main-image.txt

# - name: Full Image
# uses: addnab/docker-run-action@v3
# env:
# WORKSPACE_DIR: ${{ github.workspace }}
# GITHUB_WORKSPACE: ${{ github.workspace }}
# with:
# image: pranavmishra90/facsimilab-full:${{ steps.package.outputs.content }}
# options: --rm --user 1000:1000 --volumes-from=${{ env.JOB_CONTAINER_NAME }} --entrypoint ${{ github.workspace }}
# run: |
# cp -r ${{ github.workspace }} /home/coder/work
# cd ${{ github.workspace }} && pwd && ls -lahgR .
# echo "----------------------------------------------------"
# cd /home/coder/work/facsimilab-platform && pwd && ls -lahgR .
# /opt/conda/bin/python ${{ github.workspace }}/testing/full_image.py > testing/results/full-image.txt


- name: Write to workflow job summary
run: |
build_version=$(cat docker/image_version.txt)
builder_header="# $build_version "
echo "$builder_header" > testing/results/job_summary.md
cat "## Main Image" >> testing/results/job_summary.md
cat " " >> testing/results/job_summary.md
cat testing/results/job_summary.md >> $GITHUB_STEP_SUMMARY
# cat testing/results/main-image.txt >> testing/results/job_summary.md
# cat testing/results/full-image.txt >> testing/results/job_summary.md
97 changes: 97 additions & 0 deletions .github/workflows/bleeding-edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Bleeding Edge

on:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build-test-and-push:
runs-on: [self-hosted, linux, x64]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
clean: false
submodules: true

- name: Read the image version
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./docker/image_version.txt

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: pranavmishra90
password: ${{ secrets.DOCKERHUB_TOKEN }}


- name: Matrix Message - Starting Build
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "Starting FacsimiLab image build for tag ${{ steps.package.outputs.content }} <br><br> ${{ github.workflow }}-${{ github.ref }}"
server: "matrix.drpranavmishra.com"

- name: Build Docker images
run: bash docker/build-all.sh

- name: Matrix Message - Completed Build
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "# Completed FacsimiLab image build for tag ${{ steps.package.outputs.content }}"
server: "matrix.drpranavmishra.com"

- name: Run Facsmilab-Main container and execute script
run: |
docker pull pranavmishra90/facsimilab-main:${{ steps.package.outputs.content }}
docker run --rm -v ${{ GITHUB_WORKSPACE }}:/home/coder/work -v ~/.gitconfig:/home/coder/.gitconfig -e ENV_NAME=base pranavmishra90/facsimilab-main:${{ steps.package.outputs.content }} /opt/conda/bin/python testing/main_image.py > testing/results/main-image.txt
- name: Run Facsmilab-Full container and execute script
run: |
docker pull pranavmishra90/facsimilab-full:${{ steps.package.outputs.content }}
docker run --rm -v ${{ GITHUB_WORKSPACE }}:/home/coder/work --gpus 0 -e ENV_NAME=facsimilab pranavmishra90/facsimilab-full:${{ steps.package.outputs.content }} /opt/conda/envs/facsimilab/bin/python testing/full_image.py > testing/results/full-image.txt
# docker run --rm -v $(pwd):/home/coder/work --gpus 0 -e ENV_NAME=facsimilab pranavmishra90/facsimilab-full:dev /opt/conda/envs/facsimilab/bin/python testing/full_image.py > testing/results/full-image.txt

- name: Push Docker images
run: bash docker/push-all.sh

- name: Commit changes to git (docker image metadata)
uses: devops-infra/action-commit-push@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
# add_timestamp: false
commit_prefix: "ci(docker): "
commit_message: "Docker images built and pushed [GH Action]"
force: false
# target_branch:

- name: Write to workflow job summary
run: |
build_version=$(cat docker/image_version.txt)
builder_header="# $build_version "
echo "$builder_header" > testing/results/job_summary.md
echo "## Main Image" >> testing/results/job_summary.md
echo " " >> testing/results/job_summary.md
cat testing/results/main-image.txt >> testing/results/job_summary.md
cat testing/results/full-image.txt >> testing/results/job_summary.md
cat testing/results/job_summary.md >> $GITHUB_STEP_SUMMARY
# # notify-completed:
# # runs-on: ubuntu-latest
# steps:
- name: Matrix Message - Completed GitHub Action
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "Completed FacsimiLab build github action for tag ${{ steps.package.outputs.content }}"
server: "matrix.drpranavmishra.com"
Loading

0 comments on commit e9f1989

Please sign in to comment.