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

[BUG] error deploying docker image without existing container registry #109

Open
satarupaguha11 opened this issue Jul 26, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@satarupaguha11
Copy link

Describe the bug
All the required packages (recommended versions) are installed and deploy.parameters.json have been filled in with the required variable values. I did not create a container registry beforehand as it was not marked as a required variable.

However, it throws an error -
"Deploying docker image 'graphrag:backend' to container registry 'xxxx.azurecr.io'...Error deploying docker image, exiting.."
I have reproduced this bug both on Windows as well as WSL.

To Reproduce
Steps to reproduce the behavior:

  1. Install all the required packages in Windows/WSL
  2. Fill in all the required values in infra/deploy.parameters.json
  3. Run the command "bash deploy.sh -p deploy.parameters.json"
  4. See error "Deploying docker image 'graphrag:backend' to container registry 'xxxx.azurecr.io'...Error deploying docker image, exiting.."

Expected behavior
Deployment should automatically complete successfully.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows & WSL
  • Version 23H2

Additional context
I already had AOAI resources which I have filled in. I however didn't find any instruction about setting up cognitive services resources, so I didn't provide them anywhere.

@satarupaguha11 satarupaguha11 added the bug Something isn't working label Jul 26, 2024
@nociza
Copy link

nociza commented Jul 28, 2024

I have encountered the same problem using github codespaces.

@rnpramasamyai
Copy link

rnpramasamyai commented Jul 31, 2024

Please check below instruction:
image

@satarupaguha11
Copy link
Author

@rnpramasamyai
I already have these permissions- I am an owner of the subscription. It also works when I deploy from the devcontainer using the docker option. So access issues do not seem to be the reason for this failure.

@timothymeyers
Copy link
Contributor

@satarupaguha11 if you update

az acr build --registry $CONTAINER_REGISTRY_SERVER -f $SCRIPT_DIR/../docker/Dockerfile-backend --image $GRAPHRAG_IMAGE $SCRIPT_DIR/../ > /dev/null 2>&1
and remove > /dev/null 2>&1 from the end of the line, and run again, you should get more logging output to go on.

@cynthiajiangatl
Copy link

Add resource group to both az acr show and az acr build command. When resource group is not included, existing ACR will not be found.

createAcrIfNotExists() {
# check if container registry exists
printf "Checking if container registry exists... "
local existingRegistry
existingRegistry=$(az acr show --name $CONTAINER_REGISTRY_SERVER --resource-group $RESOURCE_GROUP --query loginServer -o tsv 2>/dev/null)
if [ $? -eq 0 ]; then
printf "Yes.\nUsing existing registry '$existingRegistry'.\n"
CONTAINER_REGISTRY_SERVER=$existingRegistry
return 0
fi
# else deploy a new container registry
printf "No.\nCreating container registry... "
AZURE_ACR_DEPLOY_RESULT=$(az deployment group create --resource-group $RESOURCE_GROUP --name "acr-deployment" --template-file core/acr/acr.bicep --only-show-errors --no-prompt -o json
--parameters "name=$CONTAINER_REGISTRY_SERVER")
exitIfCommandFailed $? "Error creating container registry, exiting..."
CONTAINER_REGISTRY_SERVER=$(jq -r .properties.outputs.loginServer.value <<< $AZURE_ACR_DEPLOY_RESULT)
exitIfValueEmpty "$CONTAINER_REGISTRY_SERVER" "Unable to parse container registry login server from deployment, exiting..."
printf "'$CONTAINER_REGISTRY_SERVER' created.\n"
}

deployDockerImageToACR() {
printf "Deploying docker image '${GRAPHRAG_IMAGE}' to container registry '${CONTAINER_REGISTRY_SERVER}'..."
local SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
#az acr build --registry $CONTAINER_REGISTRY_SERVER -f $SCRIPT_DIR/../docker/Dockerfile-backend --image $GRAPHRAG_IMAGE $SCRIPT_DIR/../ > /dev/null 2>&1
az acr build --registry $CONTAINER_REGISTRY_SERVER --resource-group $RESOURCE_GROUP -f $SCRIPT_DIR/../docker/Dockerfile-backend --image $GRAPHRAG_IMAGE $SCRIPT_DIR/../ > /dev/null 2>&1
exitIfCommandFailed $? "Error deploying docker image, exiting..."
printf " Done.\n"
}

@rnpramasamyai
Copy link

rnpramasamyai commented Aug 7, 2024

@satarupaguha11
Please update your Linux subsystem if you are using Linux on Windows. It solved many issues when I tried to deploy this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants