-
Notifications
You must be signed in to change notification settings - Fork 1.3k
chore(image-builder): Add README, update config JSON schema #14205
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/wsman-tls/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# image-builder-mk3 | ||
|
||
`image-builder-mk3` is a service that runs in meta clusters, which provides APIs to create and list workspace image builds, resolve workspace docker image references, and listen to build updates and logs. | ||
|
||
> Once completed, [#7845](https://github.com/gitpod-io/gitpod/issues/7845) will move `image-builder-mk3` (and image builds) from meta to workspace clusters. | ||
|
||
See the [Architecture page](https://www.notion.so/gitpod/Architecture-0e39e570b10f4e8ba7b259629ee3cb74) for more details, including a diagram. | ||
|
||
Relevant: | ||
* API definitions can be found [here](../image-builder-api/imgbuilder.proto) | ||
* Installer k8s config can be found [here](../../install/installer/pkg/components/image-builder-mk3/) | ||
|
||
## Development | ||
|
||
To test local changes, the following script will compile and publish a docker image, | ||
and restart the image-builder-mk3 k8s deployment at your current kube context with this image: | ||
|
||
```console | ||
# Careful: check you're pointing at the right cluster! | ||
components/image-builder-mk3/debug.sh | ||
``` | ||
|
||
### Making changes to the protocol | ||
|
||
Protocol changes are to be made in the [`image-builder-api`](../image-builder-api/) component. | ||
|
||
### Updating the installer config | ||
|
||
Changes to the installed k8s config can be done [here](../../install/installer/pkg/components/image-builder-mk3/). | ||
|
||
### Running locally | ||
|
||
To run `image-builder-mk3` locally, the `example-config.json` can be used as follows: | ||
|
||
```console | ||
cd /workspace/gitpod/components/image-builder-mk3 | ||
|
||
# Set up kube context, the image builder will connect to this cluster's ws-manager. | ||
kubectx [cluster-name] | ||
|
||
# Fetch ws-manager TLS config. | ||
gpctl clusters get-tls-config | ||
|
||
# Port forward to ws-manager. | ||
kubectl port-forward deployment/ws-manager 12001:8080 | ||
|
||
# Run image-builder-mk3. | ||
go run . run --config example-config.json | ||
``` | ||
|
||
See metrics at `http://localhost:9500/metrics`. | ||
|
||
#### Invoking RPCs | ||
|
||
When `image-builder-mk3` is running locally, you can use `grpcurl` to make gRPC requests against the API: | ||
```console | ||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest | ||
|
||
# Call RPC, e.g. ListBuilds: | ||
grpcurl -plaintext -proto /workspace/gitpod/components/image-builder-api/imgbuilder.proto -import-path=/workspace/gitpod/components/ localhost:8080 builder.ImageBuilder.ListBuilds | ||
``` | ||
|
||
See https://github.com/fullstorydev/grpcurl#invoking-rpcs for how to make different types of requests with `grpcurl`. | ||
|
||
|
||
### Running tests | ||
|
||
To run all `image-builder-mk3` tests: | ||
|
||
```console | ||
go test -v ./... | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
{ | ||
"$schema": "./config-schema.json", | ||
"builder": { | ||
"dockerCfgFile": "/home/gitpod/.docker/config.json", | ||
"gitpodLayerLoc": "/tmp/build/components-image-builder-workspace-image-layer--pack.588fcb85389f5c10ae444b52674654698f446a10/pack.tar", | ||
"baseImageRepository": "eu.gcr.io/gitpod-dev/base-images", | ||
"workspaceImageRepository": "eu.gcr.io/gitpod-dev/workspace-images", | ||
"imageBuildSalt": "001" | ||
"orchestrator": { | ||
"wsman": { | ||
"address": "localhost:12001", | ||
"tls": { | ||
"ca": "./wsman-tls/ca.crt", | ||
"crt": "./wsman-tls/tls.crt", | ||
"key": "./wsman-tls/tls.key" | ||
} | ||
}, | ||
"pullSecret": "gcp-sa-registry-auth", | ||
"baseImageRepository": "eu.gcr.io/gitpod-core-dev/build/base-images", | ||
"workspaceImageRepository": "eu.gcr.io/gitpod-core-dev/build/workspace-images", | ||
"builderImage": "eu.gcr.io/gitpod-core-dev/build/image-builder-mk3/bob:4d9d04b1bf94218d47294f83b11eba652455a790" | ||
}, | ||
"pprof": { | ||
"address": ":9999" | ||
"refCache": { | ||
"interval": "6h0m0s", | ||
"refs": [ | ||
"docker.io/gitpod/workspace-full:latest" | ||
] | ||
}, | ||
"prometheus": { | ||
"address": ":9500" | ||
}, | ||
"service": { | ||
"address": ":8080" | ||
"server": { | ||
"services": { | ||
"grpc": { | ||
"address": "0.0.0.0:8080" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 helps me to understand image-builder-bob. I wanted this README when I first developed image-builder.
What about putting a statement that this image does not include the supervisor, etc.? I think this is often misunderstood as the role of the registry-facade.
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.
Thanks @utam0k great suggestion, updated and will also put it in the architecture docs.
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.
+1