Skip to content

Commit

Permalink
upload virtualbox image as artifact using Ahnaf's suggestion, try con…
Browse files Browse the repository at this point in the history
…verting existing image
  • Loading branch information
bquan0 committed Aug 4, 2023
1 parent 1859767 commit 6c9ab17
Showing 1 changed file with 52 additions and 42 deletions.
94 changes: 52 additions & 42 deletions .github/workflows/virtualbox_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@ env:
DOCKER_IMAGE_TAG: :refs_heads_${{ github.ref_name }}-bk0

jobs:
pyne_image_build:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.output_tag.outputs.image_tag }}
# pyne_image_build:
# runs-on: ubuntu-latest
# outputs:
# image_tag: ${{ steps.output_tag.outputs.image_tag }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Log in to the Container registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Build PyNE docker image
uses: firehed/multistage-docker-build-action@v1
id: build_pyne
with:
repository: ${{ env.DOCKER_IMAGE_BASENAME }}
stages: base_python, moab, dagmc, openmc
server-stage: pyne
quiet: false
tag-latest-on-default: false
dockerfile: docker/ubuntu_22.04-dev.dockerfile
# - name: Build PyNE docker image
# uses: firehed/multistage-docker-build-action@v1
# id: build_pyne
# with:
# repository: ${{ env.DOCKER_IMAGE_BASENAME }}
# stages: base_python, moab, dagmc, openmc
# server-stage: pyne
# quiet: false
# tag-latest-on-default: false
# dockerfile: docker/ubuntu_22.04-dev.dockerfile

- id: output_tag
run: |
echo "image_tag=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT
# - id: output_tag
# run: |
# echo "image_tag=$DOCKER_IMAGE_TAG" >> $GITHUB_OUTPUT

BuildTest:
needs: [pyne_image_build]
runs-on: ubuntu-latest
# BuildTest:
# needs: [pyne_image_build]
# runs-on: ubuntu-latest

container:
image: ghcr.io/${{ github.repository_owner }}/pyne_ubuntu_22.04_py3/pyne${{ needs.multistage_image_build.outputs.image_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
# container:
# image: ghcr.io/${{ github.repository_owner }}/pyne_ubuntu_22.04_py3/pyne${{ needs.multistage_image_build.outputs.image_tag }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

- name: use BuildTest composite action
uses: ./.github/actions/build-test
with:
stage: ${{ matrix.stage }}
hdf5: ${{ matrix.hdf5 }}
# - name: use BuildTest composite action
# uses: ./.github/actions/build-test
# with:
# stage: ${{ matrix.stage }}
# hdf5: ${{ matrix.hdf5 }}

virtualbox_image_build:
needs: [BuildTest]
# needs: [BuildTest]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -72,13 +72,23 @@ jobs:
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build VirtualBox image using d2vm
run: |
curl -sL "https://github.com/linka-cloud/d2vm/releases/download/v0.2.0/d2vm_v0.2.0_linux_amd64.tar.gz" | tar -xvz d2vm
sudo mv d2vm /usr/local/bin/
echo "make worked"
sudo d2vm convert ghcr.io/${{ github.repository_owner }}/pyne_ubuntu_22.04_py3/pyne${{ env.DOCKER_IMAGE_TAG }} -p ${{ env.VM_PASSWORD }} -o pyne.vdi
sudo d2vm convert ghcr.io/bquan0/pyne_ubuntu_22.04_py3/openmc:df359b744263d9869f345ad0f374f7338b920c0d -p ${{ env.VM_PASSWORD }} -o pyne.vdi
- name: Upload VirtualBox image as artifact
uses: actions/upload-artifact@v2
with:
name: virtualbox_image
path: pyne.vdi


#
# ghcr.io/${{ github.actor }}/pyne_ubuntu_22.04_py3/pyne${{ env.DOCKER_IMAGE_TAG }}

0 comments on commit 6c9ab17

Please sign in to comment.