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

Write a script to build a package when proper signed version tag is pushed #1818

Closed
marmarek opened this Issue Mar 7, 2016 · 11 comments

Comments

@marmarek marmarek self-assigned this Mar 7, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Mar 9, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 6, 2016

Add a script to automatically build selected component
Download updated sources and if needed build it, then upload to
current-testing repository. The build log is sent to separate VM.

Fixes QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 6, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 6, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 6, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 6, 2016

auto-build: fix checking build status
check-release-status-for-component assumes builder.conf loaded into
environment. Lift this assumption

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 6, 2016

auto-build: fix checking build status
check-release-status-for-component assumes builder.conf loaded into
environment. Lift this assumption

QubesOS/qubes-issues#1818

marmarek referenced this issue in woju/qubes-core-admin Dec 6, 2016

Revert "backup: use 'scrypt' tool for backup encryption and integrity…
… protection"

This reverts commit 418d749.

Package `scrypt` is currently not installable (not present in any repo).

Cc: @marmarek
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 6, 2016

Member

A prototype: QubesOS/qubes-builder@master...marmarek:auto-build
It also automatically upload build logs to https://github.com/QubesOS/build-logs
Missing parts:

  • plugging into github hook handler (actually writing hook handler, which would call appropriate qrexec service triggering the script)
  • handling build failures - I think it should create github issue (in separate repository - don't spam qubes-issues!) with a link to build log; currently build script doesn't have easy way to get build log filename (but can upload a second copy of the log from qubes-builder/build-logs/, for example to gist).
  • consider adding some github commit status/deployment status feedback - I don't really know how it works and if could be useful (build it's not directly related to pull request)

@woju this script could use some review...

Also, it incorporate build log handling done by @HW42 as part of #2023

Member

marmarek commented Dec 6, 2016

A prototype: QubesOS/qubes-builder@master...marmarek:auto-build
It also automatically upload build logs to https://github.com/QubesOS/build-logs
Missing parts:

  • plugging into github hook handler (actually writing hook handler, which would call appropriate qrexec service triggering the script)
  • handling build failures - I think it should create github issue (in separate repository - don't spam qubes-issues!) with a link to build log; currently build script doesn't have easy way to get build log filename (but can upload a second copy of the log from qubes-builder/build-logs/, for example to gist).
  • consider adding some github commit status/deployment status feedback - I don't really know how it works and if could be useful (build it's not directly related to pull request)

@woju this script could use some review...

Also, it incorporate build log handling done by @HW42 as part of #2023

marmarek added a commit to marmarek/qubes-builder-debian that referenced this issue Dec 6, 2016

Provide dummy 'sign' target to not fail on 'make sign-all' call
This will allow using the same command to build either Fedora or Debian
package.

QubesOS/qubes-issues#1818
@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Dec 10, 2016

Member

handling build failures - I think it should create github issue (in separate repository - don't spam qubes-issues!) with a link to build log

How about QubesOS/build-issues?

consider adding some github commit status/deployment status feedback - I don't really know how it works and if could be useful (build it's not directly related to pull request)

Maybe a Gist would work for this? (Or maybe just at first, to trial it.)

Member

andrewdavidwong commented Dec 10, 2016

handling build failures - I think it should create github issue (in separate repository - don't spam qubes-issues!) with a link to build log

How about QubesOS/build-issues?

consider adding some github commit status/deployment status feedback - I don't really know how it works and if could be useful (build it's not directly related to pull request)

Maybe a Gist would work for this? (Or maybe just at first, to trial it.)

@jpouellet

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Dec 10, 2016

Contributor

If such builds are automated, then I think the infrastructure on which they are taking place should be discussed at some point.

Contributor

jpouellet commented Dec 10, 2016

If such builds are automated, then I think the infrastructure on which they are taking place should be discussed at some point.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 10, 2016

Member

How about QubesOS/build-issues?

👍

Maybe a Gist would work for this? (Or maybe just at first, to trial it.)

I don't think it is related. Build logs are already uploaded to https://github.com/QubesOS/build-logs. I was talking about https://developer.github.com/v3/repos/deployments/#create-a-deployment-status

If such builds are automated, then I think the infrastructure on which they are taking place should be discussed at some point.

What exactly do you have in mind? Where it will be running? The same as currently - on a Qubes machine(s), in a location we have physical control over. The only thing that change is how the build is triggered - "arrow up & enter" vs "pushing signed tag".

Detecting when signed tag is pushed may look non-trivial, but github allows registering hooks (an URL where events are sent using POST). It's enough to terminate HTTP(s) in NetVM and call qrexec service from there to trigger a script discussed here. It doesn't need to parse content of that POST, as the script will look what is new in the repository anyway (and do nothing, if nothing interesting there).
In practice this mechanism needs to be repeated, as the machine isn't directly reachable from the internet (the thing reachable from the internet triggers a simple network request to a NetVM of the target machine).

Member

marmarek commented Dec 10, 2016

How about QubesOS/build-issues?

👍

Maybe a Gist would work for this? (Or maybe just at first, to trial it.)

I don't think it is related. Build logs are already uploaded to https://github.com/QubesOS/build-logs. I was talking about https://developer.github.com/v3/repos/deployments/#create-a-deployment-status

If such builds are automated, then I think the infrastructure on which they are taking place should be discussed at some point.

What exactly do you have in mind? Where it will be running? The same as currently - on a Qubes machine(s), in a location we have physical control over. The only thing that change is how the build is triggered - "arrow up & enter" vs "pushing signed tag".

Detecting when signed tag is pushed may look non-trivial, but github allows registering hooks (an URL where events are sent using POST). It's enough to terminate HTTP(s) in NetVM and call qrexec service from there to trigger a script discussed here. It doesn't need to parse content of that POST, as the script will look what is new in the repository anyway (and do nothing, if nothing interesting there).
In practice this mechanism needs to be repeated, as the machine isn't directly reachable from the internet (the thing reachable from the internet triggers a simple network request to a NetVM of the target machine).

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 10, 2016

Member
Member

adrelanos commented Dec 10, 2016

@jpouellet

This comment has been minimized.

Show comment
Hide comment
@jpouellet

jpouellet Dec 10, 2016

Contributor

If such builds are automated, then I think the infrastructure on which they are taking place should be discussed at some point.

What exactly do you have in mind? Where it will be running? The same as currently - on a Qubes machine(s), in a location we have physical control over. The only thing that change is how the build is triggered - "arrow up & enter" vs "pushing signed tag".

I don't know enough about on what machines Qubes things are currently built to ask the right question.

@marmarek I suppose all Qubes users already transitively trust the physical security of your personal laptop to some (large) extent already. If builds are currently done there, and they are being transitioned to ${server} in ${datacenter} in ${jurisdiction}, then that is noteworthy to me.

Until reproducible builds are a reality, it might be nice to have some statement on the website to inform users about what build infrastructure they are trusting by using the official Qubes ISOs - unless you want to keep that information secret for opsec reasons, which I can totally understand.

Contributor

jpouellet commented Dec 10, 2016

If such builds are automated, then I think the infrastructure on which they are taking place should be discussed at some point.

What exactly do you have in mind? Where it will be running? The same as currently - on a Qubes machine(s), in a location we have physical control over. The only thing that change is how the build is triggered - "arrow up & enter" vs "pushing signed tag".

I don't know enough about on what machines Qubes things are currently built to ask the right question.

@marmarek I suppose all Qubes users already transitively trust the physical security of your personal laptop to some (large) extent already. If builds are currently done there, and they are being transitioned to ${server} in ${datacenter} in ${jurisdiction}, then that is noteworthy to me.

Until reproducible builds are a reality, it might be nice to have some statement on the website to inform users about what build infrastructure they are trusting by using the official Qubes ISOs - unless you want to keep that information secret for opsec reasons, which I can totally understand.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 10, 2016

Member

Or perhaps "cheat". Use a Tor onion service. I am using them for simple NAT traversal. Speed could perhaps also be optimized by using non-anonymous (single hop) onion services as well as single hop onion circuits.

That wouldn't work here, as github can't contact to Tor onion service...

Member

marmarek commented Dec 10, 2016

Or perhaps "cheat". Use a Tor onion service. I am using them for simple NAT traversal. Speed could perhaps also be optimized by using non-anonymous (single hop) onion services as well as single hop onion circuits.

That wouldn't work here, as github can't contact to Tor onion service...

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Dec 10, 2016

Member
Member

adrelanos commented Dec 10, 2016

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Dec 10, 2016

Member

Until reproducible builds are a reality, it might be nice to have some statement on the website to inform users about what build infrastructure they are trusting by using the official Qubes ISOs - unless you want to keep that information secret for opsec reasons, which I can totally understand.

I think you may like to read https://www.qubes-os.org/news/2016/05/30/build-security/. There is also some statement on this in http://blog.invisiblethings.org/2015/04/23/qubes-30rc1-and-roadmap.html

We're not strictly against publishing some information on build infrastructure, but I think some details should be kept secret (for example exact location of the machine(s) itself). I can say it isn't the same machine I use daily for mails etc (and also travel with). Actually we're considering preparing build infrastructure for Qubes 4.0 using salt stack and then publishing this configuration. The script discussed here is part of this infrastructure.

Member

marmarek commented Dec 10, 2016

Until reproducible builds are a reality, it might be nice to have some statement on the website to inform users about what build infrastructure they are trusting by using the official Qubes ISOs - unless you want to keep that information secret for opsec reasons, which I can totally understand.

I think you may like to read https://www.qubes-os.org/news/2016/05/30/build-security/. There is also some statement on this in http://blog.invisiblethings.org/2015/04/23/qubes-30rc1-and-roadmap.html

We're not strictly against publishing some information on build infrastructure, but I think some details should be kept secret (for example exact location of the machine(s) itself). I can say it isn't the same machine I use daily for mails etc (and also travel with). Actually we're considering preparing build infrastructure for Qubes 4.0 using salt stack and then publishing this configuration. The script discussed here is part of this infrastructure.

marmarek added a commit to marmarek/qubes-builder that referenced this issue Dec 12, 2016

Add build failure reporting
And when successfully reported, don't fail the whole process - still
upload what was built successfully.

QubesOS/qubes-issues#1818

marmarek added a commit to QubesOS/qubes-builder-debian that referenced this issue Dec 17, 2016

Provide dummy 'sign' target to not fail on 'make sign-all' call
This will allow using the same command to build either Fedora or Debian
package.

QubesOS/qubes-issues#1818

(cherry picked from commit 26befd9)
@woju

This comment has been minimized.

Show comment
Hide comment
@woju

woju Dec 19, 2016

Member

I put my comments on the commit diff, which unfortunately looks badly on the diff you linked. Otherwise looks good to me.

Member

woju commented Dec 19, 2016

I put my comments on the commit diff, which unfortunately looks badly on the diff you linked. Otherwise looks good to me.

@andrewdavidwong andrewdavidwong added this to the Release 4.0 milestone Dec 24, 2016

marmarek added a commit to marmarek/qubes-builder that referenced this issue Jan 24, 2017

Don't try to sign dom0 packages when its build failed
In case of build failure don't add dom0 to list of completed builds.

QubesOS/qubes-issues#1818
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 25, 2017

Member

Actually we're considering preparing build infrastructure for Qubes 4.0 using salt stack and then publishing this configuration. The script discussed here is part of this infrastructure.

Created #2602 for this.

Member

marmarek commented Jan 25, 2017

Actually we're considering preparing build infrastructure for Qubes 4.0 using salt stack and then publishing this configuration. The script discussed here is part of this infrastructure.

Created #2602 for this.

marmarek added a commit to marmarek/qubes-builder-github that referenced this issue Feb 12, 2017

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

Introduce 'make do-merge-versions-only'
Just like 'make do-merge' but skip repositories without version tag at
the top.

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

auto-build: improve handling uploaded build logs
- report actual filename back to the build VM
- include link to build log in build failure message
- expose build log URL to builder plugins
- log also packages upload step
- minor fixes

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

auto-build: make use of 'make do-merge-versions-only'
Don't merge changes unless we're really going to build anything.

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

auto-build: expose composite GIT_URL value
Make it easier for builder-github plugin to point to the component
sources.

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

Don't truncate build log when output is redirected to a file
When script/make-with-log is redirected to a file, don't truncate that
file - there may be some other content already (for example earlier
lines from scripts/auto-build).

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 12, 2017

auto-build: update the builder itself before doing anything else
Make sure we always use latest builder version, this will include things
like latest `qubes-developers-keys.asc` file and signature verification
scripts.

QubesOS/qubes-issues#1818

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 24, 2017

marmarek added a commit to marmarek/qubes-builder that referenced this issue Feb 24, 2017

marmarek added a commit to marmarek/qubes-builder that referenced this issue Mar 5, 2017

marmarek added a commit to marmarek/qubes-builder-rpm that referenced this issue Mar 6, 2017

Order actual update-repo code after date check, but before builder-gi…
…thub

builder-github notifications are placed as a requisite target for
`update-repo` and `update-repo-from-snapshot`. Make the same here, so
builder-github will be triggered later. This avoids false notifications
when actual update repo action fails.

QubesOS/qubes-issues#1818

marmarek added a commit to QubesOS/qubes-infrastructure that referenced this issue Mar 6, 2017

marmarek added a commit to QubesOS/qubes-infrastructure that referenced this issue Mar 6, 2017

marmarek added a commit to QubesOS/qubes-infrastructure that referenced this issue Mar 6, 2017

marmarek added a commit to QubesOS/qubes-infrastructure that referenced this issue Mar 6, 2017

Don't use += for COMPONENTS setting
It disrupts scripts/auto-build, which want to have full control over
this variable. Using += appends to it, even if already provided
externally.

QubesOS/qubes-issues#1818
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment