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: allow kurtosis cli to be used behind proxy #1496

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vanderheijden86
Copy link

@vanderheijden86 vanderheijden86 commented Oct 7, 2023

Description:

This update introduces the ability to specify a proxy URL for git operations, facilitating the cloning of repositories when behind a (corporate) proxy. Initially, this draft PR allows setting just the proxy URL, but the plan is to expand this by including a full proxy options struct that go-git utilizes, encompassing not just the URL but also the username and password for proxy authentication. The struct is outlined as follows:

type ProxyOptions struct {
	URL      string
	Username string
	Password string
}
  • Add proper test for loading of proxy config into git_package_content_provider.go
  • Provide entire ProxyOptions struct as configurable parameter instead of just URL
  • Add test to verify that ProxyOptions is picked when cloning a repo
  • Fix linting issues

Is this change user facing?

YES

References (if applicable):

#1434

@tedim52 tedim52 self-requested a review October 7, 2023 21:00
@@ -362,6 +373,16 @@ func (provider *GitPackageContentProvider) atomicClone(parsedURL *ParsedGitURL)
return nil
}

func getKurtosisConfig() (*resolved_config.KurtosisConfig, error) {
configStore := kurtosis_config.GetKurtosisConfigStore()
Copy link
Contributor

@tedim52 tedim52 Oct 11, 2023

Choose a reason for hiding this comment

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

ah so unfortunately we can't use kurtosis_config.GetKurtosisConfigStore() to retrieve the config because it pulls the config from a file on the filesystem. The git_package_content_provider.go logic lives and is executed in our APIC / core server, a container for managing each individual enclave - whereas the kurtosis config lives on the machine where the CLI is running. Bc of this we'll need to try another way of getting the proxy options into the APIC.

Copy link
Contributor

Choose a reason for hiding this comment

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

The best way to do this is to pass the proxy config option from the CLI into the engine and then from the engine into the APIC when the enclave starts a new enclave. Going to look for links + reference implementations of this pattern to guide you here and will send via discord.

// ^^^^^^^^^ Every new Kurtosis config version must have this key ^^^^^^^^

ShouldSendMetrics *bool `yaml:"should-send-metrics,omitempty"`
GitProxy *string `yaml:"git-proxy,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Another note, let's move GitProxy from the root level config to cluster config level (so it can be configured per cluster) so in KurtosisClusterConfigV3. Clusters can live at different locations - the default one is the docker cluster on the user machine, but the same proxy may not apply to every cluster so proxy should be configured depending on each cluster.

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.

None yet

2 participants