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: impl dependency list flag #2543

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

feat: impl dependency list flag #2543

wants to merge 16 commits into from

Conversation

tedim52
Copy link
Contributor

@tedim52 tedim52 commented Aug 30, 2024

Description

kurtosis run github.com/kurtosis-tech/... --dependencies returns a yaml with a list of images and packages the run will need to depend on.

Adding --pull will pull all the dependencies locally. The kurtosis.yml will be updated to use local versions of packages and Docker images are pulled onto the machine locally

Is this change user facing?

YES

@tedim52 tedim52 changed the title Tedi/dependencylist feat: impl dependency list flag Aug 30, 2024
Copy link
Collaborator

@mieubrisse mieubrisse left a comment

Choose a reason for hiding this comment

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

Wasn't sure what level of detail you wanted on this so just did the full shebang

cli/cli/commands/run/run.go Show resolved Hide resolved
cli/cli/commands/run/run.go Show resolved Hide resolved
@@ -386,6 +391,16 @@ func (interpreter *StartosisInterpreter) buildBindings(
return &predeclared, nil
}

const (
moduleIdSeperator = "/"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thought: wouldn't this constant already be declared somewhere in the Startosis engine? Should we use that instead, so we don't have two constants doing the same thing?

)

func getModulePrefix(moduleId string) string {
return strings.Join(strings.SplitN(moduleId, moduleIdSeperator, numModuleIdSeparators)[:prefixNum], moduleIdSeperator)
Copy link
Collaborator

Choose a reason for hiding this comment

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

From what I understand of SplitN, isn't numModuleIdSeparators always just prefixNum + 1 (so we don't need to maintain the extra const)?

@@ -115,7 +115,7 @@ func (suite *StartosisIntepreterPlanYamlTestSuite) TestAddServiceWithFilesArtifa
require.Nil(suite.T(), interpretationError)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this file be renamed to startosis_interpreter_plan_yaml_generator_test to match the name of PlanYaml -> PlanYamlGenerator?

@@ -813,6 +833,9 @@ tasks:
command:
- echo {{ kurtosis.4.code }} {{ kurtosis.4.output }}
image: badouralix/curl-jq
images:
- badouralix/curl-jq
- postgres:latest
`
require.Equal(suite.T(), expectedYaml, planYaml)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be a test case here where the dependenciesOnly flag is true? (assuming that, per the comment above, we maintain the dependenciesOnly flag on the PlanYamlGenerator and it's not the responsibility of the CLI or user to pull out the info they want)

prefixNum = 3
)

func getModulePrefix(moduleId string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reviewing this, it'd have been helpful to have a comment giving an example of getModulePrefix is supposed to return so that I know how to model its output in the above code

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.

2 participants