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

[Pull First Approach] Build always to global and okteto.dev #3922

Closed
jLopezbarb opened this issue Aug 18, 2023 · 2 comments · Fixed by #3940
Closed

[Pull First Approach] Build always to global and okteto.dev #3922

jLopezbarb opened this issue Aug 18, 2023 · 2 comments · Fixed by #3940
Assignees
Labels

Comments

@jLopezbarb
Copy link
Contributor

jLopezbarb commented Aug 18, 2023

Is your feature request related to a problem? Please describe.
When I run okteto deploy --build + okteto up I might have different images.

  1. Clone movies with helm
  2. Modify frontend/src/index.html:
diff --git a/frontend/src/index.html b/frontend/src/index.html
index 91d047a..366c9f3 100644
--- a/frontend/src/index.html
+++ b/frontend/src/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <title>Movies</title>
+    <title>Movies test</title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
   </head>
  1. Run okteto deploy --build
  2. Check that we have the latest changes:
Captura de pantalla 2023-08-18 a las 14 11 50
  1. Modify frontend/src/index.html:
diff --git a/frontend/src/index.html b/frontend/src/index.html
index 91d047a..5369868 100644
--- a/frontend/src/index.html
+++ b/frontend/src/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <title>Movies</title>
+    <title>Movies with okteto</title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
   </head>
  1. Run git add . && git commit -m "test"
  2. Run okteto deploy --build
  3. Modify frontend/src/index.html:
diff --git a/frontend/src/index.html b/frontend/src/index.html
index 91d047a..5369868 100644
--- a/frontend/src/index.html
+++ b/frontend/src/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
   <head>
-    <title>Movies with okteto</title>
+    <title>Movies with okteto global</title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
   </head>
  1. Run okteto deploy
  2. Check that the changes that we have is the one generated in step 3

Describe the solution you'd like
It should point to the latest image built. In this case the one in step 7. We should be pushing both tags when building with buildkit, to okteto.global/image:hash and okteto.dev/image:okteto. This will ensure that everyone uses the latest images

Additional context
We'll need to change our Build command to support a list of tags instead of a single tag.

@rlamana rlamana changed the title [pull first approach] Build always to global and okteto.dev [Pull First Approach] Build always to global and okteto.dev Aug 21, 2023
@teresaromero teresaromero self-assigned this Aug 22, 2023
@teresaromero
Copy link
Member

teresaromero commented Aug 23, 2023

Regarding the acceptance criteria of this issue i have couple of questions:

Describe the solution you'd like
It should point to the latest image built. In this case the one in step 7. We should be pushing both tags when building with buildkit, to okteto.global/image:hash and okteto.dev/image:okteto. This will ensure that everyone uses the latest images

  • When builder is Buildkit
  • When image tag is okteto.dev/image:okteto (tagged by user via -t flag, or using the build.image field at the manifest, or leaving this empty so we infer it)
    = We should push both okteto.dev/image:okteto and okteto.global/image:hash to both registries

? the hash is the SHA of the image? or is the hash of aguments?

Additional context
We'll need to change our Build command to support a list of tags instead of a single tag.

I think this should be a separate PR enabling the build option Tag to be []string instead of string

this should happen only with buildkit builds? or all the builds?

@teresaromero
Copy link
Member

teresaromero commented Aug 23, 2023

When image tag is okteto.dev/image:okteto (tagged by user via -t flag, or using the build.image field at the manifest, or leaving this empty so we infer it)

Talked offline:
When we are pushing to global, we should push to dev also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants