Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Switch to using uber-container-tools project for image registry (#305)
Browse files Browse the repository at this point in the history
* Switch to using uber-container-tools project

* Update readme
  • Loading branch information
Yiran Wang authored Feb 11, 2020
1 parent 9ed3b61 commit 354ac02
Show file tree
Hide file tree
Showing 10 changed files with 669 additions and 377 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BUILD_LDFLAGS = -X $(PACKAGE_NAME)/lib/utils.BuildHash=$(PACKAGE_VERSION)
GO_FLAGS = -gcflags '-N -l' -ldflags "$(BUILD_LDFLAGS)"
GO_VERSION = 1.12

REGISTRY ?= gcr.io/makisu-project
REGISTRY ?= gcr.io/uber-container-tools


### Targets to compile the makisu binaries.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ To build Dockerfiles that contain RUN, Makisu needs to run in a container.
To try it locally, the following snippet can be placed inside your `~/.bashrc` or `~/.zshrc`:
```shell
function makisu_build() {
makisu_version=${MAKISU_VERSION:-v0.1.11}
makisu_version=${MAKISU_VERSION:-latest}
cd ${@: -1}
docker run -i --rm --net host \
-v /var/run/docker.sock:/docker.sock \
-e DOCKER_HOST=unix:///docker.sock \
-v $(pwd):/makisu-context \
-v /tmp/makisu-storage:/makisu-storage \
gcr.io/makisu-project/makisu:$makisu_version build \
gcr.io/uber-container-tools/makisu:$makisu_version build \
--commit=explicit \
--modifyfs=true \
--load \
Expand Down Expand Up @@ -168,7 +168,7 @@ index.docker.io:
```
Registry configs can be passed in through the `--registry-config` flag, either as a file path of as a raw json blob (converted to json using [yq](https://github.com/kislyuk/yq)):
```
--registry-config='{"gcr.io": {"makisu-project/*": {"push_chunk": -1, "security": {"basic": {"username": "_json_key", "password": "<escaped key here>"}}}}}'
--registry-config='{"gcr.io": {"uber-container-tools/*": {"push_chunk": -1, "security": {"basic": {"username": "_json_key", "password": "<escaped key here>"}}}}}'
```
For more details on configuring Makisu to work with your registry client, see the [documentation](docs/REGISTRY.md).

Expand Down
21 changes: 20 additions & 1 deletion bin/makisu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,25 @@ Global Flags:
--log-level string Verbose level of logs. Valid values are "debug", "info", "warn", "error" (default "info")
--log-output string The output file path for the logs. Set to "stdout" to output to stdout (default "stdout")
$ makisu push --help
Push docker image to registries
Usage:
makisu push -t=<image_tag> [flags] <image_tar_path>
Flags:
-t, --tag string Image tag (required)
--push stringArray Registry to push image to
--replica stringArray Push targets with alternative full image names "<registry>/<repo>:<tag>"
--registry-config string Set build-time variables
-h, --help help for push
Global Flags:
--cpu-profile Profile the application
--log-fmt string The format of the logs. Valid values are "json" and "console" (default "json")
--log-level string Verbose level of logs. Valid values are "debug", "info", "warn", "error" (default "info")
--log-output string The output file path for the logs. Set to "stdout" to output to stdout (default "stdout")
$ makisu version
v0.1.11
v0.1.14
```
6 changes: 3 additions & 3 deletions docs/REGISTRY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Config struct {

Configs can be passed in through the `--registry-config` flag, either as filepath, or as a raw json blob :
```
--registry-config='{"gcr.io": {"makisu-project/*": {"push_chunk": -1, "security": {"basic": {"username": "_json_key", "password": "<escaped key here>"}}}}}'
--registry-config='{"gcr.io": {"uber-container-tools/*": {"push_chunk": -1, "security": {"basic": {"username": "_json_key", "password": "<escaped key here>"}}}}}'
```
Consider using the great tool [yq](https://github.com/kislyuk/yq) to convert your yaml configuration into the blob that can be passed in.

Expand All @@ -46,7 +46,7 @@ index.docker.io:
Example config for GCR:
```yaml
"gcr.io":
"makisu-project/*":
"uber-container-tools/*":
push_chunk: -1
security:
basic:
Expand Down Expand Up @@ -121,4 +121,4 @@ If you want to use another docker credentials helper, add its binary in the dire

## Handling `BLOB_UPLOAD_INVALID` and `BLOB_UPLOAD_UNKNOWN` errors

If you encounter these errors when pushing your image to a registry, try to use the `push_chunk: -1` option (some registries, despite implementing registry v2 do not support chunked upload, ECR and GCR being one example).
If you encounter these errors when pushing your image to a registry, try to use the `push_chunk: -1` option (some registries, despite implementing registry v2 do not support chunked upload, ECR and GCR being one example).
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ To build Dockerfiles that contain RUN, Makisu needs to run in a container.
To try it locally, the following snippet can be placed inside your `~/.bashrc` or `~/.zshrc`:
```shell
function makisu_build() {
makisu_version=${MAKISU_VERSION:-v0.1.11}
makisu_version=${MAKISU_VERSION:-latest}
cd ${@: -1}
docker run -i --rm --net host \
-v /var/run/docker.sock:/docker.sock \
-e DOCKER_HOST=unix:///docker.sock \
-v $(pwd):/makisu-context \
-v /tmp/makisu-storage:/makisu-storage \
gcr.io/makisu-project/makisu:$makisu_version build \
gcr.io/uber-container-tools/makisu:$makisu_version build \
--commit=explicit \
--modifyfs=true \
--load \
Expand Down Expand Up @@ -168,7 +168,7 @@ index.docker.io:
```
Registry configs can be passed in through the `--registry-config` flag, either as a file path of as a raw json blob (converted to json using [yq](https://github.com/kislyuk/yq)):
```
--registry-config='{"gcr.io": {"makisu-project/*": {"push_chunk": -1, "security": {"basic": {"username": "_json_key", "password": "<escaped key here>"}}}}}'
--registry-config='{"gcr.io": {"uber-container-tools/*": {"push_chunk": -1, "security": {"basic": {"username": "_json_key", "password": "<escaped key here>"}}}}}'
```
For more details on configuring Makisu to work with your registry client, see the [documentation](REGISTRY.md).

Expand Down
2 changes: 1 addition & 1 deletion examples/k8s/github-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
mountPath: /makisu-context
containers:
- name: makisu
image: gcr.io/makisu-project/makisu:v0.1.11
image: gcr.io/uber-container-tools/makisu:latest
imagePullPolicy: IfNotPresent
args:
- build
Expand Down
6 changes: 3 additions & 3 deletions examples/k8s/github-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ spec:
- name: provisioner
image: alpine/git
args:
- clone
- clone
- https://github.com/jpillora/chisel
- /makisu-context
volumeMounts:
- name: context
mountPath: /makisu-context
containers:
- name: makisu
image: gcr.io/makisu-project/makisu:v0.1.11
image: gcr.io/uber-container-tools/makisu:latest
imagePullPolicy: IfNotPresent
args:
- build
- --push=gcr.io
- --modifyfs=true
- -t=makisu-project/example-github:v0.1.11
- -t=uber-container-tools/example-github:latest
- --registry-config=/registry-config/registry.yaml
- /makisu-context
volumeMounts:
Expand Down
Loading

0 comments on commit 354ac02

Please sign in to comment.