Greetings, we are trying to run a pulumi deploy fo...
# general
Greetings, we are trying to run a pulumi deploy for dotnet inside of a Gitlab Runner Ci/Cd job. The running container is instanced via the docker+machine executor, and as such, runs a base image since we're building an aspnet service. All the AWS resources are generated correctly, however it seems to hang when publishing the image to ECR. The repository is created, however the pulumi up command just hangs. We've tried adding --verbose, but no other additional information is supplied other than the continuous addition of . for updating.... log. Are there any steps we can take to further diagnose the exact root of the issue? We have confirmed that running thus locally, it all functions as we expect.
Maximum verbosity is achieved by setting
, and since you're running in CI, you'll want to add
(otherwise the logs go to files which disappear with your build container..).
Got it. We'll try that. Is there a
docker image that has .NET 6?
Hmm, the docs don't link to the Dockerfiles.. that's an oversight. Onesec I'll check GitHub.
If you want anything other than 3.1, you'll have to build it yourself 😞
Got it. Thanks for the update @little-cartoon-10569
👍 1
Though isn't 3.1 the latest? I'm a bit out of the dotnet world these last few years..
6 is Framework. Pulumi uses Core, not Framework.
The latest version of .NET Core is .NET 6. For more information, see the summary They're trying to unify the sdks, which makes sense.
Ah. The page I looked at doesn't explain that at all well...
Yeah, hopefully this confusion will be a thing of the past now 😅
I appreciate your help
👍 1
@little-cartoon-10569 when I run
docker info
via the pulumi/pulumi-dotnet container image (invoked from pulumi up), I get
docker: command not found
. What I'm trying to track down is an apparent hang when pushing or building the image for the app. How does Pulumi handle the docker images from within the running container?
I think you're saying that your build script is running
inside the GitLab-CI container?
isn't installed by default iirc, you need to use the dind base image. Onesec, I'll get docs.
Assuming you're using a shared runner? Or have you installed the GitLabCI agent in your own image?
This page lists all the ways you can run docker from inside a container being used by GitLabCi. Note that only the dind option works with shared runners.
Yeah I had made some bad assumptions, which are now resolved. We are running our own instance of Gitlab with AWS autoscaling on the runners. I'll share the gitlab yml here as an example of how we worked around a few problems: 1. We're planning on generating a Dockerfile to change the default .NET version to 6, but for now we just install it as part of the job (for testing purposes). 2. We solved the docker communication issue by using docker:dind service to allow for communication to push the image.
Copy code
  - name: docker:20-dind
    alias: docker
    command: ["--tls=false"]

      name: pulumi/pulumi-dotnet
    when: manual
      - docker
      # AWS_ACCESS_KEY_ID supplied via CiCd variables...
      # AWS_SECRET_ACCESS_KEY supplied via CiCd variables...
      AWS_REGION: us-west-1
      PULUMI_PROJECT_DIR: ./Product.Pulumi
      DOCKER_DRIVER: overlay2
      DOCKER_HOST: <tcp://docker:2375> 
      # Prepre docker cli...
      - apt-get update && apt-get install -y ca-certificates && apt-get install -y curl && apt-get install -y gnupg && apt-get install -y lsb-release
      - curl -fsSL <> | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
      - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] <> $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
      - apt-get update && apt-get install -y docker-ce-cli
      # Install dotnet 6, will eventually bake this in our own pulumi docker image...
      - apt-get install -y wget
      - wget <>
      - bash -c Current
      # Login to our S3 backend to store / restore state...
      - pulumi login <s3://our-product-backend-bucket/$CI_COMMIT_REF_NAME>
      # Deploy...
      - pulumi stack select $CI_COMMIT_REF_NAME --create --verbose 9
      - pulumi up --stack $CI_COMMIT_REF_NAME --non-interactive --yes --skip-preview --verbose 9
Hopefully someone finds this useful if they run into a similar issue.