-
Notifications
You must be signed in to change notification settings - Fork 31
Add in-cluster offline devfile registry installation manual instruction #159
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
Changes from 2 commits
54dcd54
8b48c9c
41c4f5d
460a4ef
8809d78
496f1b7
f355285
a8843b2
c8a9b0b
380519f
702b047
dc8d130
92df126
30ea0c4
c24828f
5be8e3a
ad85faa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| :description: Installation of In-Cluster Offline Devfile Registry | ||
| :navtitle: Offline Devfile Registry | ||
| :keywords: devfile, registry, stacks | ||
|
|
||
| = Installation of In-Cluster Offline Devfile Registry | ||
|
|
||
| A devfile refers to various resources, for example container images and starter projects. The current devfile registry currently does not store those supporting resources as part of the registry. This means that a user will need to have access to those resources when using those devfiles. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To support the air gap installation of the devfile registry, the air gap scenario divides into 2 stages: | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| . Build a devfile registry based on one or more source repositories, e.g. link:https://github.com/devfile/registry[devfile/registry], to build and package up a devfile registry that contains all the resources available for offline installation. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . Install the devfile registry to a cluster to make it available for users to access the registry. | ||
|
|
||
| include::partial$proc_stage-1-build-and-package-a-devfile-registry.adoc[] | ||
|
|
||
| include::partial$proc_stage-2-install-a-devfile-registry-to-a-cluster.adoc[] | ||
|
|
||
| include::partial$proc_update-strategy-for-refreshing-registry-contents.adoc[] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| [id="stage-1-build-and-package-a-devfile-registry_{context}"] | ||
| == Stage 1: Build and Package a Devfile Registry | ||
|
|
||
| The main goal of this stage is: | ||
|
|
||
| . Pull in resources into the registry as part of the registry build. | ||
| . Modify the devfile to update references to those offline resources as part of the registry build. | ||
|
|
||
| As part of the offline devfile registry build, we need to do a few steps. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .Prerequisites | ||
|
|
||
| * Golang 1.17.x or higher | ||
| * Docker 17.05 or higher / Podman 4.0.x or higher | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Git | ||
| * Curl | ||
| * Unzip | ||
|
|
||
| === Create Offline Registry | ||
|
|
||
| Download / clone the link:https://github.com/devfile/registry[devfile/registry] repository. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would make this step a prereq: === Create Offline Registry .Prerequisite
.Procedure < the steps you have >
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jc-berger Could we rephrase it to be like: "The devfile/registry repository has been cloned"?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jc-berger This is the only step in this section, the phrase is only describing which the following commands do. |
||
|
|
||
| .Procedure: `git clone` | ||
|
|
||
| * HTTP clone | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| git clone https://github.com/devfile/registry.git /path/to/registry | ||
| ---- | ||
| + | ||
| * SSH clone | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| git clone [email protected]:devfile/registry.git /path/to/registry | ||
| ---- | ||
|
|
||
| .Procedure: Download zip | ||
|
|
||
| . Download link:https://github.com/devfile/registry[devfile/registry] | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| curl -L https://github.com/devfile/registry/archive/refs/heads/main.zip \ | ||
| -o registry.zip | ||
| ---- | ||
| + | ||
| . Unzip registry | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| unzip registry.zip -d /path/to/registry | ||
| ---- | ||
|
|
||
| .Additional resources | ||
|
|
||
| * Creating your own registry Git repository, see xref:building-a-custom-devfile-registry.adoc[Building a custom devfile registry] | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| === Packaging Starter Projects | ||
|
|
||
| To package starter projects you will need to download them manually then place them under `/stacks/<stack>/<zip>-offline.zip`. | ||
|
||
|
|
||
| *Note*: Starter projects must be packaged under a zip archive with the suffix `-offline` to be pulled into the registry. | ||
|
|
||
| .Procedure | ||
michael-valdron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| . Zip - Download zip | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| curl -L <remote-url> -o <registry_root>/stacks/<stack>/<project>-offline.zip | ||
| ---- | ||
| + | ||
| Example | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| cd /path/to/registry | ||
| curl -L https://code.quarkus.io/d?e=io.quarkus%3Aquarkus-resteasy&e=io.quarkus%3Aquarkus-micrometer&e=io.quarkus%3Aquarkus-smallrye-health&e=io.quarkus%3Aquarkus-openshift&cn=devfile \ | ||
| -o stacks/java-quarkus/community-offline.zip | ||
| ---- | ||
| + | ||
| . Git - Package cloned contents into a zip | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| git clone <remote-url> <registry_root>/stacks/<stack>/<project>-offline.zip | ||
| ---- | ||
| + | ||
| Example | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| cd /path/to/registry | ||
| git clone https://github.com/odo-devfiles/nodejs-ex.git \ | ||
| stacks/nodejs/nodejs-starter-offline.zip | ||
| ---- | ||
| + | ||
| . GitHub - Download repository as a zip archive | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| curl -L https://github.com/<user|org>/<stack_repo_name>/archive/refs/heads/<main_branch>.zip \ | ||
| -o <registry_root>/stacks/<stack>/<project>-offline.zip | ||
| ---- | ||
| + | ||
| Example | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| cd /path/to/registry | ||
| curl -L https://github.com/odo-devfiles/nodejs-ex/archive/refs/heads/master.zip \ | ||
| -o stacks/java-quarkus/nodejs-starter-offline.zip | ||
| ---- | ||
|
|
||
| === Modify Devfile | ||
|
|
||
| Modification is to the devfile will be needed to update references to those offline resources as part of the registry build. For all the items pulled into the registry, update the corresponding devfile entries to reference the resources within the offline version in the registry. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .Procedure | ||
|
|
||
| . Under `starterProjects`, find the starter project definition you want to make offline | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . Under the definition for the starter project find either `git` or `zip`, as seen here: | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| .Starter Project Before | ||
| ==== | ||
| ---- | ||
| ... | ||
| starterProjects: | ||
| - name: nodejs-starter | ||
| git: | ||
| remotes: | ||
| origin: https://github.com/odo-devfiles/nodejs-ex.git | ||
| ... | ||
| ---- | ||
| ==== | ||
| + | ||
| . Do one of the following depending on the block type: | ||
| * If `git`, replace all of the `git` block with a `zip` block and add the `location` to be the path to the local file under the stack root directory (`<registry_root>/stacks/<stack>/`). | ||
| * If `zip`, just replace the value of `location` to the same as mention for `git`. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . In either case, you should end up with something like as seen here: | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| .Starter Project After | ||
| ==== | ||
| ---- | ||
| ... | ||
| starterProjects: | ||
| - name: nodejs-starter | ||
| zip: | ||
| location: nodejs-starter-offline.zip | ||
| ... | ||
| ---- | ||
| ==== | ||
|
|
||
| .Additional resources | ||
|
|
||
| * More about starter projects in devfiles, see xref:adding-projects-to-a-devfile.adoc[Adding projects to a devfile] | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| === Build Registry | ||
|
|
||
| .Procedure | ||
|
|
||
| . Change to registry root (if not already there) | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| cd /path/to/registry | ||
| ---- | ||
| + | ||
| . Build Registry Image | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| bash .ci/build.sh | ||
| ---- | ||
|
|
||
| .Additional resources | ||
|
|
||
| * For more information about building your own registry image, see xref:building-a-custom-devfile-registry.adoc[Building a custom devfile registry] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| [id="stage-2-install-a-devfile-registry-to-a-cluster_{context}"] | ||
michael-valdron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| == Stage 2: Install a Devfile Registry to a cluster | ||
|
|
||
| The main goal of this stage (on top of the existing devfile registry install mechanism) is to install the images to the image registry. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .Prerequisites | ||
|
|
||
| * Docker 17.05 or higher / Podman 4.0.x or higher | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * OpenShift Container Platform 4.6 or higher | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| === Install Image into Cluster Image Registry | ||
|
|
||
| The process of installing the built images into an offline image registry will depend on which image registry has deployed / has access to. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .Procedure | ||
|
|
||
| . OpenShift Image Registry | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| Retag image using the form `<registry_ip>:<port>/<project>/<image>`. This can be done using `docker tag` or `podman tag`: | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| podman tag localhost/devfile-index <registry_ip>:<port>/<project>/devfile-index | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---- | ||
| + | ||
| Now you can push the retagged image to the OpenShift Image Registry at `<registry_ip>:<port>` by using `docker push` or `podman push`: | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| + | ||
| [source,bash] | ||
| ---- | ||
| podman push <registry_ip>:<port>/<project>/devfile-index | ||
| ---- | ||
|
|
||
| .Additional resources | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You also need a step that mentions updating each devfile's image references to the new, pushed image.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good catch I will add this here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @johnmcollier Done. Check out new section called |
||
|
|
||
| * For more on interacting with the OpenShift Image Registry, see link:https://docs.openshift.com/container-platform/4.10/registry/accessing-the-registry.html[Accessing the registry] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [id="update-strategy-for-refreshing-registry-contents_{context}"] | ||
| == Update strategy for refreshing registry contents | ||
|
|
||
| Steps to update an already deployed registry in the air gap scenario: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this document for updating an already running offline registry, or making an already running online registry, offline?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @johnmcollier Already running offline registry. |
||
|
|
||
| . Rerun the registry build script to rebuild the devfile registry and package up the devfile registry that contains all the resources available for offline installation. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| . Update the existing devfile registry deployment with the new devfile registry to make it available for users to access the registry. | ||
michael-valdron marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.