astro-cli icon indicating copy to clipboard operation
astro-cli copied to clipboard

Using `astro deploy` with colima is not working

Open sunkickr opened this issue 3 years ago • 3 comments

Describe the bug

The issue seems to be that docker login is not working anymore. for this to be working with colima it must be done with

All Pytests passed!
Pushing image to Astronomer registry
The push refers to repository [images.astronomer-dev.cloud/ckmzjm22937931d35puw3tcdo/cl4ogkybf14562s1q96omhr04]
9e933a9c0799: Preparing 
41cef26ad0d2: Preparing 
bace4fa01f7e: Preparing 
f0361c874bc0: Preparing 
8e8b528c1008: Preparing 
5f70bf18a086: Waiting 
7aa1460a63a9: Waiting 
6ddbfdfa2663: Waiting 
2d4836d02795: Waiting 
670df0ae3eaf: Waiting 
c9448c284e24: Waiting 
5928455b8faa: Waiting 
5d00a2aaa537: Waiting 
8bf0625426fd: Waiting 
7033ce60c163: Waiting 
1f372117d631: Waiting 
13c79935a81d: Waiting 
7fbe7620d085: Waiting 
d1910a49fce7: Waiting 
db6d3f8a8114: Waiting 
68472b43fff8: Waiting 
a5e1b13d17e7: Waiting 
2d795c040b71: Waiting 
0c12ab093adb: Waiting 
1008b6c73ce5: Waiting 
b02d7c827250: Waiting 
3670db09d21e: Waiting 
b52b205045a6: Waiting 
284a6c64b82c: Waiting 
388eedeb736e: Waiting 
2feece0964b8: Waiting 
e8b689711f21: Waiting 
unauthorized: authentication required

What CLI Version did you experience this bug?

v1.1.0

What Operating System is the above CLI installed on?

🪜 Steps To Reproduce

📸 Screenshots Screen Shot 2022-06-21 at 11 01 34 AM

sunkickr avatar Jun 21 '22 18:06 sunkickr

Haven't been able to figure out what is causing this solution on colima. I am able to confirm that if you login to the astro registry with docker login images.astronomer.cloud -u cli -p <auth-token> you would get the auth token from cloud.astronomer.io/token

sunkickr avatar Jul 05 '22 17:07 sunkickr

The issue is caused by this line: https://github.com/astronomer/astro-cli/blob/4c930766c9d5f6d77c226ea7aaf5249cce8c6b0b/airflow/docker_image.go#L225

astro fallbacks on using docker shell command if the docker library doesn't work. I guess that when using colima, we use the fallback path for some reason.

In that fallback path, the function useBash is used, but contrary to its name, it doesn't use bash at all and perform a simple exec. For this reason, the login command echo TOKEN | docker login images.astronomer.cloud -u cli --password-stdin is executed like this:

echo "TOKEN" "|" "docker" "login images.astronomer.cloud" "-u" "cli" "--password-stdin"

instead of being passed to a shell like this:

bash -c "echo TOKEN | docker login images.astronomer.cloud -u cli --password-stdin"

yannrouillard avatar Aug 09 '22 17:08 yannrouillard

@yannrouillard thanks I'll look into fixing this. Yes the docker library doesn't work with colima

sunkickr avatar Sep 21 '22 17:09 sunkickr

This is still not fixed

sunkickr avatar Oct 13 '22 15:10 sunkickr