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

install latest azd version on containers #1766

Closed

Conversation

vhvb1989
Copy link
Member

@vhvb1989 vhvb1989 commented Mar 21, 2023

Without this change, we are installing a previous version from azd on containers, instead of the latest release.

@vhvb1989 vhvb1989 requested review from jongio and wbreza as code owners March 21, 2023 05:37
@ghost ghost assigned vhvb1989 Mar 21, 2023
@azure-sdk
Copy link
Collaborator

Repoman Generation Results

Repoman pushed changes to remotes for the following projects:

Project: todo-csharp-cosmos-sql

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-cosmos-sql -b pr/1766

View Changes | Compare Changes


Project: todo-csharp-sql-swa-func

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql-swa-func -b pr/1766

View Changes | Compare Changes


Project: todo-csharp-sql

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-csharp-sql -b pr/1766

View Changes | Compare Changes


Project: todo-java-mongo-aca

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-java-mongo-aca -b pr/1766

View Changes | Compare Changes


Project: todo-java-mongo

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-java-mongo -b pr/1766

View Changes | Compare Changes


Project: todo-nodejs-mongo-aca

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-aca -b pr/1766

View Changes | Compare Changes


Project: todo-nodejs-mongo-aks

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-aks -b pr/1766

View Changes | Compare Changes


Project: todo-nodejs-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-swa-func -b pr/1766

View Changes | Compare Changes


Project: todo-nodejs-mongo

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo -b pr/1766

View Changes | Compare Changes


Project: todo-nodejs-mongo-terraform

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-nodejs-mongo-terraform -b pr/1766

View Changes | Compare Changes


Project: todo-python-mongo-aca

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-aca -b pr/1766

View Changes | Compare Changes


Project: todo-python-mongo-swa-func

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-swa-func -b pr/1766

View Changes | Compare Changes


Project: todo-python-mongo

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo -b pr/1766

View Changes | Compare Changes


Project: todo-python-mongo-terraform

Remote: azure-samples-staging

Branch: pr/1766

You can initialize this project with:

azd init -t Azure-Samples/todo-python-mongo-terraform -b pr/1766

View Changes | Compare Changes


@vhvb1989
Copy link
Member Author

blocked by: #1764

@@ -3,4 +3,4 @@ FROM --platform=amd64 mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get install -y xdg-utils \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
RUN curl -fsSL https://aka.ms/install-azd.sh | sudo bash
Copy link
Contributor

Choose a reason for hiding this comment

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

How does adding sudo change which version is installed? Or are you saying that a different version was installed in another CI step and this was failing previously?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I tried locally and this curl .... | bash just fails during docker build, leaving just a previous azd version installed within the container.
I tried in WSL2. As soon as I add the sudo there, I get latest version

Copy link
Member

Choose a reason for hiding this comment

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

@vhvb1989 Do you recall what output you got from install-azd.sh when you ran it without sudo? I am surprised that this is required. I would have expected that the inside the container the step was running at root (note, for example, how we are able to run a bunch of apt-get commands that should require root as well).

I don't doubt we have an issue here - but I'm trying to better understand what it was and why this ends up fixing it.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, I tried again and of course it is working fine now.

So, my new hypothesis is that docker is just skipping the re-build of a layer that it previously build, because it has no changes. So, I built the container some time ago, before azd-release, and now, even thought there's a new release, docker is using the same pre-built layer for me, as I haven't changed the dockerfile.

I think this is not an azd issue, or installer.

The fact that adding sudo was working, was only because I was updating the dockerfile, forcing docker to re-compile the layer.

What we could do to help devcontiners not to fall into this issue is to remove the azd-installation as a docker-layer and instead support adding config to devcontainer.json to request azd to be installed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Issue created: #1776

@vhvb1989
Copy link
Member Author

Closing as this is not the right fix. The problem is docker build cache.

@vhvb1989 vhvb1989 closed this Mar 22, 2023
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.

4 participants