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 default image tag for code executor #148

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

avimoondra
Copy link
Contributor

@avimoondra avimoondra commented Feb 6, 2024

Follow up from #145

Adds default image tag for code executor that's based on backend's image tag (after 3.20.15)

Tests

Inputs

echo "\n\n\n ====== Running tests for code-executor (helm) ======";
helm version

echo "TEST: (no tag)"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" | grep code-executor;
echo "No CE";
echo "\n";

echo "TEST: --set image.tag=3.20.16"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="3.20.16" | grep code-executor;
echo "Expecting CE (3.20.16)";
echo "\n";

echo "TEST: --set image.tag=3.20.16 --set codeExecutor.enabled=true"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="3.20.16" --set codeExecutor.enabled=true | grep code-executor;
echo "Expecting CE (3.20.16)";
echo "\n";

echo "TEST: --set image.tag=3.20.14"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="3.20.14" | grep code-executor;
echo "No CE";
echo "\n";

echo "TEST: --set image.tag=3.20.14 --set codeExecutor.image.tag=3.20.14"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="3.20.14" --set codeExecutor.image.tag="3.20.14" | grep code-executor;
echo "No CE";
echo "\n";

echo "TEST: --set image.tag=3.20.14 --set codeExecutor.enabled=true"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="3.20.14" --set codeExecutor.enabled=true | grep code-executor;
echo "Expecting CE (1.1.0)";
echo "\n";

echo "TEST: --set image.tag=3.20.14 --set codeExecutor.image.tag=2.2.0 --set codeExecutor.enabled=true"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="3.20.14" --set codeExecutor.image.tag="2.2.0" --set codeExecutor.enabled=true | grep code-executor;
echo "Expecting CE (2.2.0)";
echo "\n";

echo "TEST: --set image.tag=latest"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="latest" | grep code-executor;
echo "No CE";
echo "\n";

echo "TEST: --set image.tag=latest --set codeExecutor.enabled=true"
helm template -f ~/retool-helm/charts/retool/values.yaml foo ~/retool-helm/charts/retool --set config.encryptionKey="foo" --set image.tag="latest" --set codeExecutor.enabled=true | grep code-executor;
echo "No CE";
echo "\n";

Outputs

 ====== Running tests for code-executor (helm) ======
version.BuildInfo{Version:"v3.10.3", GitCommit:"835b7334cfe2e5e27870ab3ed4135f136eecc704", GitTreeState:"clean", GoVersion:"go1.19.4"}
TEST: (no tag)
Error: execution error at (retool/templates/deployment_jobs.yaml:51:50): Please set a value for .Values.image.tag

Use --debug flag to render out invalid YAML
No CE


TEST: --set image.tag=3.20.16
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
            value: http://foo-retool-code-executor
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
      retoolService: foo-retool-code-executor
        prometheus.io/job: foo-retool-code-executor
        retoolService: foo-retool-code-executor
        image: "tryretool/code-executor-service:3.20.16"
            value: http://foo-retool-code-executor
Expecting CE (3.20.16)


TEST: --set image.tag=3.20.16 --set codeExecutor.enabled=true
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
            value: http://foo-retool-code-executor
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
      retoolService: foo-retool-code-executor
        prometheus.io/job: foo-retool-code-executor
        retoolService: foo-retool-code-executor
        image: "tryretool/code-executor-service:3.20.16"
            value: http://foo-retool-code-executor
            value: http://foo-retool-code-executor
Expecting CE (3.20.16)


TEST: --set image.tag=3.20.14
No CE


TEST: --set image.tag=3.20.14 --set codeExecutor.image.tag=3.20.14
No CE


TEST: --set image.tag=3.20.14 --set codeExecutor.enabled=true
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
            value: http://foo-retool-code-executor
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
      retoolService: foo-retool-code-executor
        prometheus.io/job: foo-retool-code-executor
        retoolService: foo-retool-code-executor
        image: "tryretool/code-executor-service:1.1.0"
            value: http://foo-retool-code-executor
            value: http://foo-retool-code-executor
Expecting CE (1.1.0)


TEST: --set image.tag=3.20.14 --set codeExecutor.image.tag=2.2.0 --set codeExecutor.enabled=true
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
            value: http://foo-retool-code-executor
  name: foo-retool-code-executor
    retoolService: foo-retool-code-executor
      retoolService: foo-retool-code-executor
        prometheus.io/job: foo-retool-code-executor
        retoolService: foo-retool-code-executor
        image: "tryretool/code-executor-service:2.2.0"
            value: http://foo-retool-code-executor
            value: http://foo-retool-code-executor
Expecting CE (2.2.0)


TEST: --set image.tag=latest
No CE


TEST: --set image.tag=latest --set codeExecutor.enabled=true
Error: execution error at (retool/templates/deployment_code_executor.yaml:53:63): If using image.tag=latest (not recommended, select an explicit tag instead) and enabling codeExecutor, explicitly set codeExecutor.image.tag

Use --debug flag to render out invalid YAML
No CE

Also tested w/ Helm 3.7 👍 ✅

@avimoondra avimoondra changed the title add default for code executor add default image tag for code executor Feb 6, 2024
@avimoondra avimoondra force-pushed the avimoondra/add-fallback-version-for-code-executor branch from 539e93f to a330ab6 Compare February 6, 2024 20:45
@avimoondra avimoondra merged commit 199f806 into main Feb 7, 2024
12 checks passed
@avimoondra avimoondra deleted the avimoondra/add-fallback-version-for-code-executor branch February 7, 2024 16:35
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