Skip to content
Merged
Changes from all commits
Commits
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
39 changes: 39 additions & 0 deletions INSTALLER-HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are a member of the organization.

Do you mean member of OpenShift organization in github?

```
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 .
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 crictl image rm

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
```