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

Buildpacks CLI (pack) downloader #2454

Closed
manusa opened this issue Nov 20, 2023 · 1 comment · Fixed by #2495
Closed

Buildpacks CLI (pack) downloader #2454

manusa opened this issue Nov 20, 2023 · 1 comment · Fixed by #2495
Assignees
Milestone

Comments

@manusa
Copy link
Member

manusa commented Nov 20, 2023

Description

Part of #439

As a JKube developer, I want to be able to let JKube automatically download a Buildpacks CLI (pack) binary compatible with my platform and system architecture, so that I can invoke a consistent version of the CLI tool (see #2453).

TODO:

  • Define the binary source URLs or method to infer them
  • Define the target location for the downloaded binaries
  • Define what happens if the downloaded binary is corrupt (recover, force update)
  • Define what happens in an air-gapped environment (should we fallback to existent CLI?)
@manusa manusa changed the title Buildpacks CLI (pack) downloader Buildpacks CLI (pack) downloader Nov 22, 2023
@rohanKanojia rohanKanojia self-assigned this Nov 24, 2023
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 24, 2023
…GitHub (eclipse-jkube#2454)

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@rohanKanojia
Copy link
Member

rohanKanojia commented Nov 27, 2023

  • Define the binary source URLs or method to infer them
    As agreed internally at standup meeting, we decided that binary source download URL, version and other attributes could be inferred from parent pom via properties:

        # BuildPack related properties in Parent Pom
      <version.cli.pack.upstream.github>v0.32.1</version.cli.pack.upstream.github>
      <download-link.cli.pack.upstream.github>https://github.com/buildpacks/pack/releases/download</download-link.cli.pack.upstream.github>
      <binary-prefix.cli.pack.upstream.github>pack</binary-prefix.cli.pack.upstream.github>
      <archive-suffix.unix.cli.pack.upstream.github>tgz</archive-suffix.unix.cli.pack.upstream.github>
      <archive-suffix.windows.cli.pack.upstream.github>zip</archive-suffix.windows.cli.pack.upstream.github>
  • Define the target location for the downloaded binaries
    .jkube

  • Define what happens if the downloaded binary is corrupt (recover, force update)
    When JKube detects a pack binary already present on system, it checks whether it's in expected state by running pack --version command. If these conditions are satisfied, binary is considered to be in a usable state:

    • Command completes successfully
    • pack CLI version is equal to expected version by JKube

Otherwise, download is triggered.

  • Define what happens in an air-gapped environment (should we fallback to existent CLI?)

    If download fails, JKube would look for pack CLI already present on machine. It would check whether it's valid or not by checking (pack --version) command. If previous step is successful, then we use the binary already present on User's system.

    • Shall we enforce user to have pack CLI only above certain version? Shall we throw error if user has pack CLI with old version?
    • What if download is done via proxy? Shall we pass maven proxy settings while doing download?

rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…GitHub (eclipse-jkube#2454)

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…lipse-jkube#2454)

This module would contain all the required classes for BuildPack related
classes like BuildPackCLIController, BuildPackBuildCommand,
BuildPackCLIDownloader etc.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 27, 2023
…lipse-jkube#2454)

This module would contain all the required classes for BuildPack related
classes like BuildPackCLIController, BuildPackBuildCommand,
BuildPackCLIDownloader etc.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 28, 2023
…lipse-jkube#2454)

This module would contain all the required classes for BuildPack related
classes like BuildPackCLIController, BuildPackBuildCommand,
BuildPackCLIDownloader etc.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 28, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 28, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Nov 28, 2023
)

This module would contain all the required classes for BuildPack related
classes like BuildPackCLIController, BuildPackBuildCommand,
BuildPackCLIDownloader etc.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 29, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 29, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 29, 2023
…ies (eclipse-jkube#2454)

Add CLIDownloaderUtil to download CLI binaries from remote sources.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 30, 2023
…ad archives (eclipse-jkube#2454)

+ Refactor IoUtil.download method to be able to extract response body
  for further consumption
+ Add IoUtil.downloadArchive method to download and extract archive to
  specified folder

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 30, 2023
…ad archives (eclipse-jkube#2454)

+ Refactor IoUtil.download method to be able to extract response body
  for further consumption
+ Add IoUtil.downloadArchive method to download and extract archive to
  specified folder

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Nov 30, 2023
…ad archives (eclipse-jkube#2454)

+ Refactor IoUtil.download method to be able to extract response body
  for further consumption
+ Add IoUtil.downloadArchive method to download and extract archive to
  specified folder

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit that referenced this issue Nov 30, 2023
…ad archives (#2454)

+ Refactor IoUtil.download method to be able to extract response body
  for further consumption
+ Add IoUtil.downloadArchive method to download and extract archive to
  specified folder

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@manusa manusa added this to the 1.16.0 milestone Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants