Giter VIP home page Giter VIP logo

ttl.sh's Introduction

Develop on Okteto

ttl.sh

An ephemeral container registry for CI workflows.

What is ttl.sh?

ttl.sh is an anonymous, expiring Docker container registry using the official Docker Registry image. This is a set of tools and configurations that can be used to deploy the registry without authentication, but with self-expiring images.

Development

Development for the services in this project is done through Okteto.

Setup

  1. Install the Okteto CLI (brew install okteto)
  2. Setup Okteto CLI (okteto context use https://replicated.okteto.dev)
  3. Setup Okteto context in kubectl (okteto context update-kubeconfig)
  4. Deploy your current branch. (from the ttl.sh root directory: okteto pipeline deploy)

Debugging

Okteto is utilized for debugging. New build targets have been added to allow building and running each service in debug mode.

  1. Replace the default container in your Okteto environment with a development container.
    1. From the root directory: okteto up or okteto up <service name>
  2. Run the build targets for the desired service:
    1. ttl-hooks: make deps build hooks
    2. ttl-reaper: make deps build reap
  3. Stop development and go back to the default container.
    1. From the root directory: okteto down or okteto down <service name>

Example workflows

Switching branches or rebasing

  1. git checkout my-new-branch
  2. okteto pipeline deploy
  3. (make code changes)
  4. okteto up
  5. (test changes, find they don't work, make more changes)...
  6. okteto down
  7. (commit code, and be happy)

ttl.sh's People

Contributors

ad-m avatar danielhelfand avatar dependabot[bot] avatar dydx avatar marccampbell avatar ogtrilliams avatar sgalsaleh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ttl.sh's Issues

OCI artifacts are not delete with the image

When uploading OCI artifacts with an image, they are not removed when the image expires:

$ crane ls ttl.sh/slsapoc
sha256-1cb5afe8bf4d159f6a7ebc5aa676366e43c1147a7ff2b8e05414a05be364a357.att
sha256-1cb5afe8bf4d159f6a7ebc5aa676366e43c1147a7ff2b8e05414a05be364a357.sig
sha256-669a37977f429bab60af7e82c12bca071824a4ffd89b93aec6614231a896a282.att
sha256-669a37977f429bab60af7e82c12bca071824a4ffd89b93aec6614231a896a282.sig
sha256-6e847778c78369bd386fb4203d1664f8f20d64fd6945a43e5cbb68e587c6064d.att
sha256-6e847778c78369bd386fb4203d1664f8f20d64fd6945a43e5cbb68e587c6064d.sig
sha256-7c2fb77bf9a5eae1561974f8adbe95a475a8bdf74cd805aa30127ae313cd58b7.att
sha256-7c2fb77bf9a5eae1561974f8adbe95a475a8bdf74cd805aa30127ae313cd58b7.sig

The image with the tag latest or10m is not there anymore, but the previous signatures and attestations persisted.

Delete only handles docker v2 image manifests

If I push a multi-platform image, or an OCI image, they aren't being cleaned after the timeout. I believe it's related to

"Accept": "application/vnd.docker.distribution.manifest.v2+json",
which only has one accept header. In my own projects, I accept:

  • application/vnd.docker.distribution.manifest.v1+json
  • application/vnd.docker.distribution.manifest.v1+prettyjws
  • application/vnd.docker.distribution.manifest.v2+json
  • application/vnd.docker.distribution.manifest.list.v2+json
  • application/vnd.oci.image.manifest.v1+json
  • application/vnd.oci.image.index.v1+json

The registry itself will automatically resolve a multi-platform image to linux/amd64 by default if you don't request the manifest list, so you end up with the following (5 minutes had passed):

$ docker pull --platform linux/amd64 ttl.sh/library/busybox:5m
5m: Pulling from library/busybox
manifest for ttl.sh/library/busybox:5m not found: manifest unknown: manifest unknown

$ docker pull --platform linux/arm/v5 ttl.sh/library/busybox:5m
5m: Pulling from library/busybox
3a7a3789f986: Pull complete 
Digest: sha256:139abcf41943b8bcd4bc5c42ee71ddc9402c7ad69ad9e177b0a9bc4541f14924
Status: Downloaded newer image for ttl.sh/library/busybox:5m
ttl.sh/library/busybox:5m

uuidgen on macOS creates upper case uuid

See the error from docker:

export IMAGE_NAME=$(uuidgen)
$ docker build -t ttl.sh/${IMAGE_NAME}:1h .
invalid argument "ttl.sh/A028C747-D344-4B85-AF58-FC59A321788D:1h" for "-t, --tag" flag: invalid reference format: repository name must be lowercase
$ docker version
Docker version 20.10.10, build b485636f4b

Suggestion to make the frontpage of ttl.sh say:

export IMAGE_NAME=$(uuidgen | tr '[:upper:]' '[:lower:]')

Images should be tagged "latest" while pushing

It would be good to retag the images as latest. This would enable:

docker build -t replreg.is/uuid/uuid:1h .
docker push replreg.is/uuid/uuid:1h

And then pulling with just

docker pull replreg.is/uuid/uuid

We should keep the timestamp tag too, for compatibility and because it's probably expected.

Support immutable tags

Supporting immutable tags would be great to be sure the pushed images aren't modified in any way. I think this could be controllable by the path of the image, something like tth.sh/immutable/<uuid>:<tag> could indicate this image should be immutable.

error `413 request entity too large` while pushing an image

I am getting an error while pushing to ttl.sh, 413 request entity too large.
https://github.com/waveywaves/backstage/actions/runs/3103852916/jobs/5027642820#step:16:661

Based on the docker documentation I understand that the following configuration is necessary to get around this issue
https://docs.docker.com/registry/recipes/nginx/#setting-things-up

# disable any limits to avoid HTTP 413 for large image uploads
client_max_body_size 0;

Image still available even after 1 hour

Hi,

I pushed yesterday an image... which shouldn't be available today.

Here is what I have done :

$ docker push ttl.sh/${IMAGE_NAME}:1h
The push refers to repository [ttl.sh/8097e2f7-fb1d-4a24-845d-48b5d597f8a4]
0804652eb60a: Pushed 
4f77f01cd59a: Pushed 
aeccf26589a7: Pushed 
f640be0d5aad: Pushed 
aa4330046b37: Pushed 
ad10b481abe7: Pushed 
69715584ec78: Pushed 

12 hours later :

$ docker push ttl.sh/${IMAGE_NAME}:1h
The push refers to repository [ttl.sh/8097e2f7-fb1d-4a24-845d-48b5d597f8a4]
0804652eb60a: Pushed 
4f77f01cd59a: Pushed 
aeccf26589a7: Pushed 
f640be0d5aad: Pushed 
aa4330046b37: Pushed 
ad10b481abe7: Pushed 
69715584ec78: Pushed 

Then... I can stilll pull the image.

$ docker pull ttl.sh/${IMAGE_NAME}:1h

1h: Pulling from 8097e2f7-fb1d-4a24-845d-48b5d597f8a4
79e9f2f55bf5: Pull complete 
0d96da54f60b: Pull complete 
5b27040df4a2: Pull complete 
e2ead8259a04: Pull complete 
3790aef225b9: Pull complete 
186297f03b96: Pull complete 
9dd4a5b2b3a0: Pull complete 
Digest: sha256:aabba69b5f956aea6eb3b7b46331e29229a03e7ef50c7c2e13559bdbd4e89431
Status: Downloaded newer image for ttl.sh/8097e2f7-fb1d-4a24-845d-48b5d597f8a4:1h
ttl.sh/8097e2f7-fb1d-4a24-845d-48b5d597f8a4:1h

Did I do something wrong ?

Steps to host your own ttl.sh

I was trying to setup ttl.sh on my own system, but got stuck since there are no clear steps documented to do so.

This is what I tried.

  • Manually build the docker image, from registry folder.
  • After the build, tried to run the image, using different possible combinations of docker run:
    • docker run -itd ttlsh:v1 -> got this error Set GCS_KEY_ENCODED variable configuration error: error parsing /etc/docker/registry/config.yml: yaml: line 16: mapping values are not allowed in this context
    • docker run -itd -e PORT=5000 -e GCS_KEY_ENCODED=Z2NzCg== -e REPLREG_HOST=0.0.0.0 -e REPLREG_SECRET=secret ttlsh:v1 -> got error panic: invalid character 'g' looking for beginning of value

What is the correct way to run it. There are lot of env variables defined in entrypoint.sh, what those each variables means?
variables: PORT,HOOK_TOKEN, HOOK_URI, REPLREG_HOST, REPLREG_SECRET, GCS_KEY_ENCODED.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.