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

Added automated docker build process #266

Merged
merged 180 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
128c266
Attempting with new image and uncommented lines in test script
Nov 10, 2023
bed12a0
Resolving merge conflicts
Nov 10, 2023
5e9a4ae
Pushed new image again to test latest version of SiEPIC repos
Nov 11, 2023
32d0635
Adding libx11 packages to docker image and triggering workflow
Nov 12, 2023
608b4cf
Adding xvfb steps in yaml file
Nov 12, 2023
a53a842
Installing X11 dependencies inside yaml file
Nov 12, 2023
871d434
Removed incorrect background setting in yaml file
Nov 12, 2023
85952e7
Added xhost + command in yaml file
Nov 12, 2023
6fd0534
Adding xfvb run in exec command in yaml file
Nov 12, 2023
c50d1f6
Removing xhost + command
Nov 12, 2023
dc197fa
Added xvfb package inside docker file
Nov 12, 2023
670eea1
Dockerfile for testing on this repo
jasminabrar Nov 14, 2023
2276205
Merging so I can push Dockerfile
jasminabrar Nov 14, 2023
bf20122
Delete Dockerfile
jasminabrar Nov 14, 2023
72a494c
Reverting test script to last actions passing version
Nov 14, 2023
e13f2df
Fixed missing library name ebeam dream
Nov 14, 2023
896b8d3
Adding comments
jasminabrar Nov 14, 2023
e239b6e
Removing ebeam dream from libnames temporarily from test script
Nov 14, 2023
31c861b
Merge remote-tracking branch 'refs/remotes/origin/master'
Nov 14, 2023
199b2c8
Adding redundant period to trigger workflow; ebeam dream still tempor…
Nov 14, 2023
cad1ccc
Pulling reverted version of image
Nov 14, 2023
01c0af6
Removing xvfb part of klayout exec command
Nov 14, 2023
bfbd66c
Merge branch 'SiEPIC:master' into master
jasminabrar Nov 14, 2023
abcca18
for building docker image on github actions
jasminabrar Nov 15, 2023
77990c9
merging
jasminabrar Nov 15, 2023
3f1df8e
Create docker-image.yml
jasminabrar Nov 15, 2023
8972d30
Update docker-image.yml
jasminabrar Nov 15, 2023
4b444a1
Update docker-image.yml
jasminabrar Nov 15, 2023
c40fcc3
Use new docker image built using GitHub actions
jasminabrar Nov 15, 2023
d374e3f
Adding Docker Hub login
jasminabrar Nov 15, 2023
913cfce
Update to build and push image to container registry
jasminabrar Nov 15, 2023
fd04a9d
Fix name error
jasminabrar Nov 15, 2023
16cf738
Use new docker image uploaded to my account
jasminabrar Nov 15, 2023
fe594cc
Update EBeam_Lib_PCellTests.py
jasminabrar Nov 15, 2023
5ae6400
remove on push so this action is not triggered for now
jasminabrar Nov 15, 2023
4f278da
Update docker run command
jasminabrar Nov 15, 2023
db9277d
remove x11 forwarding in docker run command
jasminabrar Nov 15, 2023
3bc3ce1
use a virtual display
jasminabrar Nov 15, 2023
9cb168e
build new image + add date to tag
jasminabrar Nov 15, 2023
b04f77a
use xvfb and new docker image that includes xvfb
jasminabrar Nov 15, 2023
dcdc444
Add install Xvfb
jasminabrar Nov 15, 2023
4eb9a24
add period to trigger GitHub action
jasminabrar Nov 15, 2023
e090d86
remove period to trigger GitHub action
jasminabrar Nov 15, 2023
1e06685
remove xvfb
jasminabrar Nov 15, 2023
15e3d73
remove on push
jasminabrar Nov 15, 2023
9a40a80
remove xvfb
jasminabrar Nov 15, 2023
9e0f25e
clone old version of siepic tools
jasminabrar Nov 15, 2023
a9e3e44
Updating tag to reflect using v0.4.5 siepic tools
jasminabrar Nov 15, 2023
571c615
Use docker image with siepic tools v0.4.5
jasminabrar Nov 15, 2023
7bbd507
Remove install xvfb
jasminabrar Nov 15, 2023
7b0850c
remove on push
jasminabrar Nov 15, 2023
3eee5a8
add x11 forwarding back into docker exec command
jasminabrar Nov 15, 2023
ea151c4
Only run when Dockerfile is modified
jasminabrar Nov 16, 2023
958eed7
Run when new versions of siepic repos are released + update tag
jasminabrar Nov 16, 2023
56da49f
Revert back to cloning newest siepic repos
jasminabrar Nov 16, 2023
8a476b0
Attempt to fix insufficient scope error
jasminabrar Nov 16, 2023
2608dea
Add period to trigger docker image build
jasminabrar Nov 16, 2023
5d00a3b
git clone jasminabrar siepic tools
jasminabrar Nov 16, 2023
6aad4eb
Use new docker image with jasminabrar siepic tools repo
jasminabrar Nov 16, 2023
44b3f4e
remove extra 'docker pull'
jasminabrar Nov 16, 2023
70b1883
remove display from docker exec
jasminabrar Nov 16, 2023
7972365
Rebuild Dockerfile without ENV variables
jasminabrar Nov 16, 2023
04dfe7a
use new docker image
jasminabrar Nov 16, 2023
3ae6031
Update EBeam_Tests.yml
jasminabrar Nov 16, 2023
05d256f
catch general pcell exceptions
jasminabrar Nov 16, 2023
a753710
merging
jasminabrar Nov 16, 2023
dd68e21
remove x11 display
jasminabrar Nov 16, 2023
a36b951
add back in ENV variables
jasminabrar Nov 16, 2023
c3a99d3
use v21 docker image
jasminabrar Nov 16, 2023
dccc3d8
move display to docker run
jasminabrar Nov 16, 2023
7e85db2
add -zz
jasminabrar Nov 16, 2023
dd716d1
remove 'docker pull
jasminabrar Nov 16, 2023
06b5813
use v22 docker image
jasminabrar Nov 16, 2023
5e2505e
use docker image with v0.4.5 siepic tools for now as it works
jasminabrar Nov 16, 2023
54596f5
Push docker image as 'latest' and with a unique tag
jasminabrar Nov 17, 2023
c690683
Trigger docker image build
jasminabrar Nov 17, 2023
01b0775
fix build error
jasminabrar Nov 17, 2023
d2c6684
trigger build
jasminabrar Nov 17, 2023
ae22ebc
update tag
jasminabrar Nov 17, 2023
98196d5
trigger build image
jasminabrar Nov 17, 2023
0951087
clone v0.4.5 siepic tools
jasminabrar Nov 17, 2023
f03f102
clone SiEPIC SiEPIC_Tools not jasminabrar
jasminabrar Nov 17, 2023
63913c5
Create docker_image_version_info
jasminabrar Nov 17, 2023
0fb2a35
update tag
jasminabrar Nov 17, 2023
14cd1bd
trigger docker build
jasminabrar Nov 17, 2023
5ed22a3
Update tag
jasminabrar Nov 17, 2023
a6d68b4
trigger build image
jasminabrar Nov 17, 2023
a7b73be
always use master-latest docker image
jasminabrar Nov 17, 2023
e15651b
Check pull requests are merged before triggering workflow
jasminabrar Nov 17, 2023
8938037
Updating comments
jasminabrar Nov 17, 2023
6e63f30
Cleaning up comments
jasminabrar Nov 17, 2023
911f5ed
Cleaning up
jasminabrar Nov 17, 2023
18b753f
Cleaning up
jasminabrar Nov 17, 2023
716dc14
add code coverage section
jasminabrar Nov 17, 2023
631a6dc
Update EBeam_Tests.yml
jasminabrar Nov 17, 2023
b9c6c1a
Attempting to redo last commit and adding coverage upload step right …
FarihaIS Nov 17, 2023
88e6904
Temporarily moving code coverage report upload to after stopping the …
FarihaIS Nov 17, 2023
37d089d
Created EBeam_Tests_Coverage.yml to trigger passing of actions contai…
FarihaIS Nov 17, 2023
37cb489
Renaming coverage actions and removing trigger for on pushes to maste…
FarihaIS Nov 17, 2023
dce3332
Adding steps to run klayout script with coverage and temporarily comm…
FarihaIS Nov 17, 2023
1d09ceb
Updating Dockerfile to include installation of pip
FarihaIS Nov 17, 2023
51bae22
Adding pip install coverage package inside Dockerfile
FarihaIS Nov 17, 2023
bb41556
Removing pip install coverage line from actions file as it is already…
FarihaIS Nov 17, 2023
3c485a4
Removing space to trigger ebeam_tests action
FarihaIS Nov 17, 2023
c90e7b1
Trying to add double quotes for exec command that uses coverage
FarihaIS Nov 17, 2023
e3c6a34
Trying to add codecov badge to readme
FarihaIS Nov 17, 2023
8350edb
Trying to rename text of badge to 'coverage'
FarihaIS Nov 17, 2023
ef84dde
Trying (again) to rename the text to 'coverage' and not 'codecov'
FarihaIS Nov 18, 2023
e10fc3f
Keeping the previous 'codecov' text on the badge as previous attempts…
FarihaIS Nov 18, 2023
938bf17
Trying a different version of klayout coverage run commands
FarihaIS Nov 18, 2023
5416b1a
Trying to dynamically locate klayout before running coverage command …
FarihaIS Nov 18, 2023
46a95c2
Trying to figure out klayout path for coverage run klayout command
FarihaIS Nov 18, 2023
22271cf
Adding shell script to run klayout command
FarihaIS Nov 18, 2023
b9b286b
Changing creation of shell script to be more explicit in actions file
FarihaIS Nov 18, 2023
c9f95ca
Adding bash in front of run shell script command in actions file
FarihaIS Nov 18, 2023
a0de181
Removed syntax error; trying bash in front of shell script run comman…
FarihaIS Nov 18, 2023
c020c53
Removing the sh -c from run klayout commands
FarihaIS Nov 18, 2023
81c8309
Trying previous version of commands again
FarihaIS Nov 18, 2023
2e8c8f6
Running without coverage command to get run actions with latest SiEPI…
FarihaIS Nov 18, 2023
6606b3d
use jasminabrar siepic tools with deleted qwidget file
jasminabrar Nov 21, 2023
9a707fd
trigger action
jasminabrar Nov 21, 2023
d8247af
More changes made to jasminabrar siepic tools repo
jasminabrar Nov 21, 2023
35e1265
trigger build
jasminabrar Nov 21, 2023
b1a1982
trigger action
jasminabrar Nov 22, 2023
bb361c7
use newest siepic tools
jasminabrar Nov 22, 2023
9cc7158
trigger action
jasminabrar Nov 22, 2023
181ec51
Use jasminabrar siepic tools 0.4.5
jasminabrar Nov 22, 2023
fae92ee
trigger action
jasminabrar Nov 22, 2023
816c317
build new image with layout.py using 0.4.6 code, rest of siepic tools…
jasminabrar Nov 22, 2023
324ec5a
trigger action
jasminabrar Nov 22, 2023
cfa79ed
build new image with layout.py + geometry.py using 0.4.6 code, rest o…
jasminabrar Nov 22, 2023
33a634f
trigger action
jasminabrar Nov 22, 2023
b611c11
build new image with partial u 0.4.6 code
jasminabrar Nov 22, 2023
5dd7fb5
trigger action
jasminabrar Nov 22, 2023
a4a2a7d
build new image using partial 0.4.6 code
jasminabrar Nov 22, 2023
787cde9
trigger action
jasminabrar Nov 22, 2023
d4ece02
update image to user partial 0.4.6 siepic tools
jasminabrar Nov 22, 2023
26f7814
trigger action
jasminabrar Nov 22, 2023
048650f
build new image using partial 0.4.6 code
jasminabrar Nov 22, 2023
28b0906
trigger action
jasminabrar Nov 22, 2023
53f5ad7
build new image using partial 0.4.6 code
jasminabrar Nov 22, 2023
a5cd9b2
trigger action
jasminabrar Nov 22, 2023
fc65620
update image to use all of 0.4.6 siepic tools
jasminabrar Nov 22, 2023
cf213b1
trigger action
jasminabrar Nov 22, 2023
16555dd
build image using added change I missed in extend.py
jasminabrar Nov 22, 2023
95daffc
trigger action
jasminabrar Nov 22, 2023
1b43261
build with more updates to match 0.4.6
jasminabrar Nov 22, 2023
208d828
trigger action
jasminabrar Nov 22, 2023
50b95c4
updates siepic.lym in siepic tools repo to match 0.4.6
jasminabrar Nov 22, 2023
b496a45
Update EBeam_Tests.yml
jasminabrar Nov 22, 2023
feda2a9
build new image with updated globals.py for 0.4.6
jasminabrar Nov 22, 2023
7a4d04d
trigger build
jasminabrar Nov 22, 2023
8de4f40
build new image with changes to globals.py
jasminabrar Nov 23, 2023
e9c2b4f
trigger action
jasminabrar Nov 23, 2023
8541f0f
build new image with more changes to global.py
jasminabrar Nov 23, 2023
77156b8
trigger action
jasminabrar Nov 23, 2023
cc076ff
build new image with changes to global.py
jasminabrar Nov 23, 2023
4304bc6
trigger action
jasminabrar Nov 23, 2023
8d44f21
build new image with updated global.oy
jasminabrar Nov 23, 2023
99a91c6
trigger action
jasminabrar Nov 23, 2023
26c99b7
build new image with updated global.py
jasminabrar Nov 23, 2023
d904339
trigger action
jasminabrar Nov 23, 2023
5b54e01
build new image with changes to _globals.py
jasminabrar Nov 23, 2023
3f06e22
trigger action
jasminabrar Nov 23, 2023
87c9910
new image with updated __globals.py
jasminabrar Nov 23, 2023
abeade3
trigger action
jasminabrar Nov 23, 2023
d2266d2
build image with newest siepic tools + installing numpy
jasminabrar Nov 23, 2023
f308aa6
trigger action
jasminabrar Nov 23, 2023
bbc4f0d
build new image with newest siepic tools that should have qwidget err…
jasminabrar Nov 23, 2023
437906d
trigger action
jasminabrar Nov 23, 2023
266e7e1
Remove commented out lines and codecov step
jasminabrar Nov 23, 2023
1b9f76e
Delete .github/workflows/Coverage_EBeam_Tests.yml
jasminabrar Nov 23, 2023
80fd2f2
Remove unnecessary period
jasminabrar Nov 23, 2023
856e1aa
Rename docker-image.yml to Docker_Image.yml
jasminabrar Nov 23, 2023
027ff19
Cleaning up Dockerfile
jasminabrar Nov 23, 2023
fce7cbd
remove codecov button
jasminabrar Nov 23, 2023
9f31829
remove extra line
jasminabrar Nov 23, 2023
40ba776
Delete docker_image_version_info
jasminabrar Nov 23, 2023
2d5b3d7
Add redundant period
jasminabrar Nov 23, 2023
a336a88
Merge pull request #3 from jasminabrar/test1
jasminabrar Nov 23, 2023
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
75 changes: 75 additions & 0 deletions .github/workflows/Docker_Image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Create and Publish Docker Image

on:
release:
types:
- created
repository:
- 'SiEPIC/SiEPIC_EBeam_PDK'
- 'SiEPIC/SiEPIC-Tools'

push:
branches: [ "master" ]
paths:
- 'Dockerfile'
pull_request:
types:
- closed
branches: [ "master" ]
paths:
- 'Dockerfile'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/siepic_klayout

jobs:
build-and-push-image:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check pull request was merged
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == false
run: |
echo "Error: Pull request is not merged."
exit 1

- name: Checkout repository
uses: actions/checkout@v4

- name: Get the current date
id: date
run: echo "::set-output name=date::$(date +%Y%m%d)"

- name: Log in to the container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image as latest image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}-latest
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image as unique image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: "${{ steps.meta.outputs.tags }}.${{ steps.date.outputs.date }}.${{ github.run_number }}"
labels: ${{ steps.meta.outputs.labels }}
19 changes: 9 additions & 10 deletions .github/workflows/EBeam_Tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

name: EBeam Tests
name: EBeam Tests

on:
push:
Expand All @@ -9,35 +8,35 @@ on:
branches:
- master

jobs:
jobs:
ebeam-lib-pcell-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Pull siepic_klayout image
run: docker pull ghcr.io/farihais/siepic_klayout:latest

- name: Pull siepic_klayout image
run: docker pull ghcr.io/jasminabrar/siepic_ebeam_pdk/siepic_klayout:master-latest

- name: Run docker container from image
run: docker run -itd --name ebeam_test -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --security-opt label=type:container_runtime_t ghcr.io/farihais/siepic_klayout:latest
run: docker run -itd --name ebeam_test -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --security-opt label=type:container_runtime_t ghcr.io/jasminabrar/siepic_ebeam_pdk/siepic_klayout:master-latest

- name: Copy pymacros folder to docker container
run: docker cp $GITHUB_WORKSPACE/klayout/EBeam/pymacros ebeam_test:/home/pymacros

- name: Run KLayout Python script inside container and capture exit code
- name: Run KLayout Python script inside container and capture exit code
run: docker exec ebeam_test klayout -zz -r pymacros/EBeam_Lib_PCellTests.py || echo "KLAYOUT_EXIT_CODE=$?" >> $GITHUB_ENV
continue-on-error: true

- name: Stop container and remove it
run: |
docker stop ebeam_test
docker rm ebeam_test

- name: Fail job if exit code is non-zero
run: |
if [ $KLAYOUT_EXIT_CODE -ne 0 ]; then
echo "KLayout exited with non-zero exit code"
exit 1
fi
fi
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM quay.io/centos/centos:stream8

# Update the system and install necessary tools.
RUN dnf -y update && \
dnf -y install wget bzip2 unzip git mesa-dri-drivers python3-pip

# Install the newest version of KLayout
RUN wget https://www.klayout.org/downloads/CentOS_8/klayout-0.28.12-0.x86_64.rpm -O ~/klayout.rpm && \
dnf -y localinstall ~/klayout.rpm && \
rm ~/klayout.rpm

# Clone SiEPIC-Tools and SiEPIC_EBeam_PDK.
RUN mkdir -p /root/.klayout/salt && \
cd /root/.klayout/salt && \
git clone https://github.com/SiEPIC/SiEPIC-Tools.git && \
git clone https://github.com/SiEPIC/SiEPIC_EBeam_PDK.git

# Set the working directory
WORKDIR /home

# Set PATH
ENV PATH="/usr/local/bin:${PATH}:/usr/local/bin/python3:/root/.local/bin"
ENV QT_QPA_PLATFORM=minimal
19 changes: 3 additions & 16 deletions klayout/EBeam/pymacros/EBeam_Lib_PCellTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
exec(open(custom_exceptions_path).read())

"""
Python script to test that all Pcells are properly registered in their respective library and will display polygons when placed on a new layout.
Python script to test that all EBeam libraries are registered and all Pcells are properly registered in their respective library and
will display polygons when placed on a new layout.

To run this script from the command line: '{path to klayout} -zz -r {path to this script/EBeam_Lib_PCellTests.py}'.

Expand Down Expand Up @@ -97,24 +98,10 @@
#inst = topcell.insert(CellInstArray(pcell.cell_index(), t))


except (PCellRegistrationError, PCellInstantiationError) as e:
except (PCellRegistrationError, PCellInstantiationError, Exception) as e:
print("Caught {}: {}".format(type(e).__name__, str(e)))
pya.Application.instance().exit(1)

print("Complete. All pcells from {} folder were successfully registered in {} library".format(library_folders[i], library_names[i]))

print("Complete. All pcells were succcessfully registered in all libraries.")














Loading