-
Notifications
You must be signed in to change notification settings - Fork 111
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
Initial how to build info and Make targets #107
Conversation
README-development.md
Outdated
- ostree | ||
- rpm-ostree | ||
- imagefactory-plugins-TinMan | ||
- qemu-img |
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.
Hmm, might be worth inlining these requires into the building steps. That way if one just wants to know how to compose an OSTree, they don't need to install e.g. imgfac (which pulls in libvirt + systemd).
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.
Offline suggestion: link the exotic tools to their repo (or, if they have it, to their "how to install" doc).
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.
Most of this is yum -y install
, with a few exceptions, those we should call out.
README-development.md
Outdated
- ``ostree --repo=repo remote add rhcos --no-gpg-verify ${OSTREE_INSTALL_URL}`` | ||
- ``ostree --repo=repo pull --mirror --commit-metadata-only rhcos`` | ||
- ``imagefactory --debug base_image --file-parameter install_script cloud.ks --parameter offline_icicle True rhcos.tdl`` | ||
- ``export IMAGE=`ls /var/lib/imagefactory/storage/*.body``` |
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.
Oh neat! I didn't know that you could use double ticks on the outside to safely use single ticks `
inside them!
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.
I'm not sure you can 😆
@@ -1,3 +1,39 @@ | |||
# Operating System |
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.
I run basically all of this from a container, and so does the pipeline (except for Imagefactory for bad reasons). I think we should recommend that as well; it's mentioned below for the rpm-ostree bits. In fact we could just recommend pulling quay.io/cgwalters/coreos-assembler
and running things in there right?
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.
Switched coreos-assembler
to use podman
README-development.md
Outdated
- ostree | ||
- rpm-ostree | ||
- imagefactory-plugins-TinMan | ||
- qemu-img |
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.
Most of this is yum -y install
, with a few exceptions, those we should call out.
README-development.md
Outdated
- ``rpmdistro-gitoverlay build`` | ||
- Make the ostree | ||
- ``export REPO=/tmp/repo`` | ||
- ``ostree init --repo=$REPO --mode=archive --src $REPO/ --dest=$REPO`` |
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.
These --src/--dest
args seem like a copy/paste error from rsync?
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.
I actually wasn't 100% sure the right way to convert these lines from the Jenkinsfile without actually going through and testing out to see what happens.
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.
It doesn't look like --src $REPO/ --dest=$REPO
was dropped, definitely should be.
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.
It's now removed
README-development.md
Outdated
- ``export REPO=/tmp/repo`` | ||
- ``ostree init --repo=$REPO --mode=archive --src $REPO/ --dest=$REPO`` | ||
- ``coreos-assembler --repo=$REPO host.yaml`` | ||
- ``ostree summary --repo=$REPO --update --dest $REPO/ --src=$REPO`` |
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.
Ditto.
README-development.md
Outdated
- Make the ostree | ||
- ``export REPO=/tmp/repo`` | ||
- ``ostree init --repo=$REPO --mode=archive --src $REPO/ --dest=$REPO`` | ||
- ``coreos-assembler --repo=$REPO host.yaml`` |
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.
rpm-ostree from git master supports the yaml...but this is OK for now.
README-development.md
Outdated
- Make the qcow2 | ||
- ``ostree --repo=repo remote add rhcos --no-gpg-verify ${OSTREE_INSTALL_URL}`` | ||
- ``ostree --repo=repo pull --mirror --commit-metadata-only rhcos`` | ||
- ``imagefactory --debug base_image --file-parameter install_script cloud.ks --parameter offline_icicle True rhcos.tdl`` |
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 is missing two sed
s for subbing out OSTREE_INSTALL_URL
and OSTREE_INSTALL_REF
. Though we can probably hardcode the latter at least now. (It was originally written to be usable for both CentOS and RHEL-derived input).
README-development.md
Outdated
|
||
- git | ||
- coreos-assembler | ||
- rpmdistro-gitoverlay |
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 additionally requires fedpkg
and mock
.
Updates based on feedback. |
963931a
to
77b7e5e
Compare
README-development.md
Outdated
- ``export REPO=/tmp/repo`` | ||
- ``ostree init --repo=$REPO --mode=archive`` | ||
- ``podman run --privileged --rm -v $REPO:/srv quay.io/cgwalters/coreos-assembler`` | ||
- ``cd /srv && coreos-assembler --repo=/srv --cachedir=cache host.yml`` |
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.
I used the coreos-assembler
container to run all the commands up to here (including the rdgo ones).
If you follow the steps verbatim, the coreos-assembler
command will fall over because there is no openshift.repo
file available in openshift/os
I was able to generate the openshift.repo
with the generate-openshift-repo
command in the openshift/os
repo, but then we fall over due to missing the Red Hat GPG key.
So I propose that the additional steps of:
- running
generate-openshift-repo
- copying the Red Hat GPG key into
/etc/pki/rpm-gpg/
...then running the coreos-assembler
command.
(It might also be worth noting separately that the coreos-assembler
command is not going to work unless you have access to the Red Hat stage CDN, just to dissuade anyone who is curious)
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.
I was also going through the steps, and hit the same. For the former there seems to be already a make repo-refresh
(similarly for init). For the latter I'm confused because it seems to bail on a gpgcheck=0
repo; is there a way to hook repo configs to relative paths from this git-repo?
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.
Yeah, we can.
README-development.md
Outdated
- mock | ||
|
||
### May need to be built from source | ||
- [coreos-assembler](https://github.com/cgwalters/coreos-assembler/): [container](http://quay.io/cgwalters/coreos-assembler) |
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.
Note #119 should make this unnecessary.
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.
Is coreos-assembler
deprecated at this point as well?
I'm fine merging this as is, it doesn't need to be perfect, and will clearly change over time. |
@cgwalters I agree it doesn't have to be perfect. However, I'm going to turn these commands into make targets, and update this doc. At that point I'd like to have it re-reviewed for merging. |
/hold |
Updated with make targets. I don't think it's quite ready to merge but close. Questions:
@lucab @jlebon @cgwalters @miabbott PTAL |
/hold cancel |
@ashcrow See here: https://github.com/openshift/os/blob/master/pipeline-utils.groovy#L52 |
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 is cool, though it's missing the "linking" between each target. E.g. ideally make rpmostree-compose
would pick up the RPMs we just created with make rdgo
, and similarly, make os-image
would point to the OSTree repo.
I think that's something we could do later though. At least we have the basic targets that codify what each step entails.
Makefile
Outdated
@@ -3,6 +3,10 @@ COMPOSEFLAGS ?= | |||
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | |||
CACHE_ARGS := $(shell if test -d cache; then echo $(shell pwd)/cache; fi) | |||
|
|||
REPO ?= /tmp/repo |
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.
How about something like /srv/rhcos/repo
?
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.
Sure. Will update.
README-development.md
Outdated
- ``export IMAGE=`ls /var/lib/imagefactory/storage/*.body``` | ||
- ``qemu-img convert -f raw -O qcow2 $IMAGE rhcos-devel.qcow2`` | ||
- Build packages from source repos: ``make rdgo`` | ||
- Make the ostree: ``OSTREE_INSTALL_URL=<OSTREE_INSTALL_URL_HERE> make rpmostree-compose`` |
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.
Minor: I think the more standard way of setting vars when calling make is make <target> VAR1=val1 VAR2=val2...
.
|
The |
@miabbott Are you thinking that we should add that directory to the |
@ashcrow It would probably make sense in terms of keeping things tidy. |
.PHONY: os-image | ||
os-image: | ||
ostree --repo=repo remote add rhcos --no-gpg-verify ${OSTREE_INSTALL_URL} | ||
ostree --repo=repo pull --mirror --commit-metadata-only rhcos |
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.
Hmm...I think if you're doing local builds you want to be using the local ostree repo. That's what I do.
The annoying pain point is it requires setting up a webserver. See projectatomic/rpm-ostree-toolbox#68 and there's other PRs/issues around this too.
A high level question here too is how much of this flow should live in https://github.com/cgwalters/coreos-assembler I think having an opinionated container makes sense (versus delivering as an RPM as Anyways...I'm OK to merge this as is too. Trying to change the Jenkinsfiles is going to be a whole other world. |
README-development.md
Outdated
- ``export IMAGE=`ls /var/lib/imagefactory/storage/*.body``` | ||
- ``qemu-img convert -f raw -O qcow2 $IMAGE rhcos-devel.qcow2`` | ||
- Build packages from source repos: ``make rdgo`` | ||
- Make the ostree: ``make rpmostree-compose OSTREE_INSTALL_URL=<OSTREE_INSTALL_URL_HERE> `` |
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.
I think this INSTALL_URL
should be for make os-image
right?
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.
To be clear I'm OK to /lgtm
after this small tweak, but up to you how much else you want to change.
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.
Updated.
Signed-off-by: Steve Milner <smilner@redhat.com>
Updated |
/lgtm |
I fear this has never been actually manually tried. There are a few gaps here and there (rpm-gpg assets, no valid |
@lucab you are correct. There is work that needs to happen before someone who didn't actively work on the Jenkinsfiles and work on the underlying infrastructure can follow and recreate what's going on. There is also a side thing @cgwalters is doing in terms of changing the pipeline which may change some things. Unfortunately I don't think we will be able to really finish #108 until the pipeline relaxes in flux once again. |
A question has come up over how one would build RHCOS. The original Container Linux has this document explaining how to do so. Today the closest we have is for one to look at
Jenkinsfile.*
s.This would let people run one or more
make
targets locally to build a local development version of RHCOS.See #108