-
Notifications
You must be signed in to change notification settings - Fork 251
HACKING: add steps for how to build the node image. #107
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,42 @@ To reduce memory usage, you can remove some non-essential components from the cl | |
``` | ||
export HACK_MINIMIZE=1 | ||
``` | ||
|
||
### Developing with a local copy of openshift-sdn | ||
|
||
Origin images are difficult to build correctly. If you want to test some binary changes with openshift-sdn, there's an easier way. | ||
|
||
#### One-time setup: | ||
1. Set up your API credentials: | ||
- Log on to https://api.ci.openshift.org/ with your GitHub credentials | ||
- On the top right, click copy login command. Execute it in a terminal | ||
- Execute `oc registry login`, which will install credentials for your local podman and docker clients | ||
2. Create the following dockerfile in your origin repo: | ||
``` | ||
cat <<EOF > Dockerfile.node-hacking | ||
FROM docker.io/openshift/origin-node:v4.0.0 | ||
COPY _output/local/bin/linux/amd64/openshift-sdn /usr/bin/openshift-sdn | ||
EOF | ||
``` | ||
|
||
#### Building a development sdn image | ||
1. Pick a registry. You can use the Openshift CI one if you are a member of the organization. | ||
``` | ||
export REGISTRY=registry.svc.ci.openshift.org/<YOUR-GITHUB-USERNAME> | ||
``` | ||
|
||
2. Build the sdn process | ||
``` | ||
make WHAT=./cmd/openshift-sdn | ||
``` | ||
|
||
3. Build and push the node image | ||
``` | ||
podman build -t ${REGISTRY}/origin-node:latest -f Dockerfile.node-hacking . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe tag with a "weird" version number here (and request that version below) to ensure that if you did something wrong, it will just fail rather than giving you an upstream image? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only advantage of latest is that it has an implicit ImagePullPolicy of Always. Otherwise you have to bump the tag, change the daemonset's image pull policy, or manually do a You are right to be worried about somehow accidentally pushing to the wrong place. |
||
podman push ${REGISTRY}/origin-node:latest | ||
``` | ||
|
||
4. Follow the steps above, but override the node image reference in step 3. | ||
``` | ||
echo "NODE_IMAGE=${REGISTRY}/origin-node:latest" >> ${CLUSTER_DIR}/env.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.
Do you mean member of OpenShift organization in github?