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

feat: oci support (Beta) #18646

Open
wants to merge 58 commits into
base: master
Choose a base branch
from

Conversation

blakepettersson
Copy link
Member

@blakepettersson blakepettersson commented Jun 13, 2024

This is a WIP for OCI support in Argo CD. This is the implementation PR for the proposal in #17564.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

@blakepettersson blakepettersson requested review from a team as code owners June 13, 2024 23:04
Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blakepettersson , The overall code on the PR looks good so far. This is an amazing start to the feature. I have not tested stuff yet though.

One thing we might need to look into is how can we reduce the number of calls to OCI repositories like adding some caching for resolve revision and extract calls. Something what we already do for git ls-remote calls. But this can be a future enhancement.

util/oci/client.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
pkg/apis/application/v1alpha1/repository_types.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
@blakepettersson blakepettersson changed the base branch from oci-integration to master August 22, 2024 11:18
util/oci/client.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
util/oci/client.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Sep 7, 2024

Codecov Report

Attention: Patch coverage is 42.50412% with 349 lines in your changes missing coverage. Please review.

Project coverage is 53.11%. Comparing base (5e30858) to head (3a76a77).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
util/oci/client.go 44.22% 171 Missing and 27 partials ⚠️
reposerver/repository/repository.go 22.64% 77 Missing and 5 partials ⚠️
server/application/application.go 0.00% 24 Missing ⚠️
reposerver/cache/cache.go 0.00% 13 Missing ⚠️
pkg/apis/application/v1alpha1/repository_types.go 16.66% 10 Missing ⚠️
util/io/files/tar.go 41.17% 10 Missing ⚠️
cmd/argocd/commands/repo.go 0.00% 5 Missing ⚠️
util/db/repository_secrets.go 57.14% 2 Missing and 1 partial ⚠️
util/oci/tags.go 87.50% 2 Missing and 1 partial ⚠️
util/argo/argo.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18646      +/-   ##
==========================================
- Coverage   55.20%   53.11%   -2.09%     
==========================================
  Files         338      339       +1     
  Lines       57090    57614     +524     
==========================================
- Hits        31516    30604     -912     
- Misses      22878    24329    +1451     
+ Partials     2696     2681      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blakepettersson blakepettersson changed the title feat: super duper wip oci support feat: oci support (wip) Sep 9, 2024
@agaudreault agaudreault marked this pull request as draft September 10, 2024 16:39
@@ -40,6 +40,7 @@ export interface NewHTTPSRepoParams {
project?: string;
forceHttpBasicAuth?: boolean;
enableOCI: boolean;
insecureHttpOnly: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Around line 308 of this file, it should show an icon for the repo type. Unfortunately, the change should be in the argo ui repo, so will need to create a PR there. See:

https://github.com/argoproj/argo-ui/blob/master/src/styles/argo-icon.scss and the icons folder there, that should contain the new oci svg icon.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithchong that's a good point! I'm not much of a designer though, so would need help from someone to create the icon...

message += ' (' + revision.substring(0, 14) + ')';
} else {
message += ' (' + revision.substring(0, 7) + ')';
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that the <Revision> field in the lines below need to take into account the format of the revision value as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly - do you have any formatting in mind? Would you want the sha256 prefix to be removed?

@blakepettersson blakepettersson changed the title feat: oci support (wip) feat: oci support Sep 19, 2024
@blakepettersson blakepettersson force-pushed the feature/oci branch 2 times, most recently from a439909 to 2e7848c Compare October 2, 2024 20:54
@blakepettersson blakepettersson changed the title feat: oci support feat: oci support (Beta) Oct 3, 2024
blakepettersson and others added 29 commits December 18, 2024 23:29
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
If a tar file is embedded in the layer, decompress it and move its contents to the manifests dir.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
This is really adding a bunch of prereqs to be able to do e2e tests with oci.

This installs ORAS CLI, and adds CLI support for OCI repos.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants