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 install-acm subcommand #5

Open
KevinFCormier opened this issue Feb 4, 2021 · 2 comments
Open

Add install-acm subcommand #5

KevinFCormier opened this issue Feb 4, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@KevinFCormier
Copy link
Collaborator

KevinFCormier commented Feb 4, 2021

This command would leverage deploy as a dependency, and possibly pipeline as well to support selection of a snapshot version.

Need to consider the simplest way for a user to provide their quay.io pull secret via the user.env file or other means.

This would be very similiar to startrhacm by @dhaiducek, except that it would include only the installation of ACM. Need to look at this project for inspiration and potential areas to re-use.

With this command, a cm user could obtain a new cluster and install ACM on it like so (options TBD):

cm new cluster-pool new-hub && cm install-acm new-hub
@KevinFCormier KevinFCormier added the enhancement New feature or request label Feb 4, 2021
@dhaiducek
Copy link

dhaiducek commented Feb 4, 2021

Downstream is a straightforward curl since acm-custom-registry is open. (Check out the link for how I looped over all of the pages since curl only returns one page from Quay.)

  RHACM_SNAPSHOT=$(curl -s https://quay.io/api/v1/repository/acm-d/acm-custom-registry/tag/ | jq -r '.tags[].name' | grep -v "nonesuch\|-$" | grep "${USER_SNAPSHOT}" | grep -F "${RHACM_VERSION}" | grep -F "${BRANCH}."| head -n 1)

https://github.com/dhaiducek/startrhacm/blob/6389ad45a1a4ec25fcc408a15b46a4faeb9323eb/startrhacm.sh#L166-L179

Something to consider: I will say that while using Quay may be more straightforward since you can probably leverage the Quay token as you said, I think you'll lose the ability to distinguish between a stable and edge build specified in pipeline. But if you're upstream, perhaps that doesn't matter anyway. The tags in Quay will be easier to retrieve (just like the command above, which could probably be reused) since you wouldn't have to reconfigure the manifest filename into a tag like I'm currently doing in startrhacm (or maybe you'll find a cleverer way! 🙂 ):

    MANIFEST_TAG=$(ls ${RHACM_PIPELINE_PATH}/snapshots/manifest-* | grep -F "${VERSION_NUM}" | tail -n 1 | grep -o "[[:digit:]]\{4\}\(-[[:digit:]]\{2\}\)\{5\}.*")
    SNAPSHOT_TAG=$(echo ${MANIFEST_TAG} | grep -o "[[:digit:]]\{4\}\(-[[:digit:]]\{2\}\)\{5\}")
    VERSION_NUM=$(echo ${MANIFEST_TAG} | grep -o "\([[:digit:]]\+\.\)\{2\}[[:digit:]]\+")
    RHACM_SNAPSHOT="${VERSION_NUM}-SNAPSHOT-${SNAPSHOT_TAG}"

https://github.com/dhaiducek/startrhacm/blob/5cb725e83a4ca5f177a2ccac089e673d2c32dfa1/startrhacm.sh#L164-L171

@KevinFCormier
Copy link
Collaborator Author

@dhaiducek Thanks for the tips!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants