Acceleration Service provides a general service to Harbor with the ability to automatically convert user images to accelerated images. When a user does something such as artifact push, Harbor will request the service to complete the corresponding image conversion through its integrated Nydus, eStargz, etc. drivers.
See more details in the design doc.
Deploy a local harbor service if you don't have one, please refer to the harbor documentation.
Currently, Acceleration Service includes the following tools:
acceld
daemon to work as an HTTP service to handle image conversion requests from harbor or accelctl
.accelctl
CLI tool to manage acceleration service (acceld
) and can do image conversion in one-time mode.Get accelctl
and acceld
binaries from acceleration-service release.
Login to the Harbor web interface.
Select one project and add a new Webhook configuration with the following fields:
<acceleration service address>
/api/v1/conversions<configured in acceleration service>
Note: The webhook can help to convert images automatically by acceleration service. Also you can trigger an image conversion task by sending an HTTP request manually or using accelctl.
Create a system robot account with following fields:
<by your choice>
When you get the robot account robot$<robot-name>
, please copy the secret and
generate a base64 encoded auth string like this:
$ echo -n '<robot-name>:<robot-secret>' | base64
Note: the encoded auth string will be used in configuring acceleration service on the next step.
provider.source
with your own harbor service hostname, the auth
and
webhook.auth_header
should also be configured as the one generated by the above step.converter.driver
filed according to your requirements.
Please follow the comments in the template config file.
$ ./acceld --config ./config.yaml
$ docker push <harbor-service-address>/library/nginx:latest
accelctl
CLI tool.
Please make sure the source OCI v1 images exist in your harbor registry.
$ ./accelctl task create <harbor-service-address>/library/nginx:latest
Or you can create a conversion task over the HTTP API by
curl
. Please refer to the development document.$ curl --location 'http://<acceleration-service-address>/api/v1/conversions?sync=$snyc' \ --header 'Content-Type: application/json' \ --data '{ "type": "PUSH_ARTIFACT", "event_data": { "resources": [ { "resource_url": "<harbor-service-address>/dfns/alpine:latest" } ] } } '
One-time mode allows to do a conversion without starting the acceld service, using accelctl like this:
$ ./accelctl convert --config ./config.yaml 192.168.1.1/library/nginx:latest
INFO[2022-01-28T03:39:28.039029557Z] pulling image 192.168.1.1/library/nginx:latest module=converter
INFO[2022-01-28T03:39:28.075375146Z] pulled image 192.168.1.1/library/nginx:latest module=converter
INFO[2022-01-28T03:39:28.075530522Z] converting image 192.168.1.1/library/nginx:latest module=converter
INFO[2022-01-28T03:39:29.561103924Z] converted image 192.168.1.1/library/nginx:latest-nydus module=converter
INFO[2022-01-28T03:39:29.561197593Z] pushing image 192.168.1.1/library/nginx:latest-nydus module=converter
INFO[2022-01-28T03:39:29.587585066Z] pushed image 192.168.1.1/library/nginx:latest-nydus module=converter
You can see the converted image and source oci image in the some repo, they have different tag suffix.