Skip to content
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

Add registry support for dynamic stack updates [1/2] #1505

Open
4 tasks
thepetk opened this issue Apr 9, 2024 · 0 comments
Open
4 tasks

Add registry support for dynamic stack updates [1/2] #1505

thepetk opened this issue Apr 9, 2024 · 0 comments
Labels
area/ci area/registry Devfile registry for stacks and infrastructure demo Issue or PR candidate for a demo at the end of the Sprint kind/epic A high level requirement that can/should be split into smaller issues

Comments

@thepetk
Copy link
Contributor

thepetk commented Apr 9, 2024

/kind user-story

Which area this user story is related to?

/area ci
/area registry

User Story

As a stack owner trying to create a new stack version, update an existing one or even introduce a new stack, I want to be able to see this change in the registry (e.g. the community registry) shortly after my PR is merged. This way, I don't have to wait for the new deployment of the devfile services team.

This user story focuses on the support of dynamic updates on stacks, like a creation/update of a stack version, or the creation of a new stack in general. Those updates should be available on the deployed registry shortly after the merge of each PR updating the stacks/ dir.

Current Format

The current flow of the devfile registry:

  • Pushes all devfile artifacts inside the oci-registry.
  • Uses a generated index.json file (stored inside the devfile-registry container, generated from the index/generator) to parse the indexSchema.
  • The registry-viewer supports specific paths predefined during the build process.

As a result, in order to update the contents of an existing stack or create a new one, someone should:

  • Update the artifacts inside the oci-registry.
  • Regenerate the index.json.
  • Regenerate the routes of the registry-viewer.

Suggested workaround

The key concept of the suggested workaround is to create a mechanism that will take care of the update of the OCI registry and the index.json so the index/server can fetch the updated information. In addition to that, the registry-viewer should be able to support dynamic routing so we are able to see every change in the viewer's interface.

Additional context

Some more details about the necessary changes required to implement the suggested workaround are:

Support generating index.json directly from github

The index/generator should be able to generate the index.json directly from github if a github URL is provided as a CLI arg.

Add the monitored registry repo's URL as ENV Var to the registry deployment

A registry deployment will support dynamic updates only if a specific env var is set during the deployment, pointing to the registry repo we would like to monitor.

Include the commit hash of the registry to the index.json

To be able to compare the different versions of the registry used to generate the index.json, the index/generator should include the commit hash used to generate the file, so we can compare it with another version.

Store index.json in oci-registry & use a cached version in the devfile-registry

The index.json should be moved to the OCI registry and get updated after every stack update. To avoid the index/server (runs inside devfile-registry container) fetching the index.json from the oci-registry, we should store a cached version inside the devfile-registry. Additionally to that we should create a mechanism inside the devfile-registry container that will take care to compare periodically the cached index.json version with the one stored in the OCI registry.

Support dynamic routing in the registry-viewer

The registry viewer should be able to support dynamic routing, so every time a new stack is added in the index.json it can serve the new stack's page.

Add functionality for OCI registry updates

After all the above steps are done, we are sure that we can support any updates made to the OCI registry. The next step is to implement the functionality that will take care of the OCI registry artifacts update and re-generate the index.json.

This functionality should only run after a specific request to the index/server made from the registry repository.

Create post-merge job on the registry side

The last step will be to create a post-merge action which will:

  • Check if the merged updates affect the stacks/ directory.
  • If yes it should send an authenticated request to the deployed registry, so the OCI registry update task runs.

Acceptance Criteria

**NOTE: This is the first of two parts for this EPIC. The rest of the action items required are here

As described in the above sections the acceptance criteria are:

@openshift-ci openshift-ci bot added kind/user-story User story for new enhancement area/ci area/registry Devfile registry for stacks and infrastructure labels Apr 9, 2024
@thepetk thepetk added the kind/epic A high level requirement that can/should be split into smaller issues label Apr 9, 2024
@johnmcollier johnmcollier added the demo Issue or PR candidate for a demo at the end of the Sprint label Apr 24, 2024
@thepetk thepetk changed the title Add registry support for dynamic stack updates Add registry support for dynamic stack updates [1/2] Apr 26, 2024
@yangcao77 yangcao77 removed the kind/user-story User story for new enhancement label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci area/registry Devfile registry for stacks and infrastructure demo Issue or PR candidate for a demo at the end of the Sprint kind/epic A high level requirement that can/should be split into smaller issues
Projects
Status: Backlog
Development

No branches or pull requests

3 participants