This message was deleted.
# general
s
This message was deleted.
b
can you share what you have?
a
after cleaning it up a little bit, this is basically what I'm working with:
Copy code
image: python:3.7.9-buster
before_script:
  - apt-get update -y
  - apt-get install sudo -y
  - python3 -m venv infra/venv
  - infra/venv/bin/python -m pip install --upgrade pip setuptools wheel
  - infra/venv/bin/python -m pip install -r infra/requirements.txt
  - bash ./pulumiSetup/setup.sh

stages:
  - preview
  - deploy

pulumi-preview:
  stage: preview
  services:
    - docker:dind
  script:
    - bash ./pulumiSetup/pulumi-preview.sh

pulumi-deploy:
  stage: deploy
  services:
    - docker:dind
  script:
    - bash ./pulumiSetup/pulumi-up.sh
  only:
    - master
the scripts
pulumiSetup/setup.sh
is like this:
Copy code
#!/bin/bash

# exit if a command returns a non-zero exit code
# print the commands and their args as they are executed
set -e -x

# Download and install required tools
# update the GitLab Runner and install other packages
apt-get update -y
apt-get install sudo python3-pip python3-venv unzip wget curl -y

curl -fsSL <https://get.pulumi.com/> | bash
export PATH=$PATH:$HOME/.pulumi/bin
export PULUMI_ACCESS_TOKEN=$PULUMI_ACCESS_TOKEN

# Login into pulumi. This will require the PULUMI_ACCESS_TOKEN environment variable
# pulumi config set --secret pulumi-access-token $PULUMI_ACCESS_TOKEN
pulumi login

curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"
unzip -qq awscliv2.zip
sudo ./aws/install
and the script 
pulumiSetup/pulumi-preview.sh
 is like this:
Copy code
#!/bin/bash

# exit if a command returns a non-zero exit code
# print the commands and their args as they are executed
set -e -x

# Add the pulumi CLI to the PATH
export PATH=$PATH:$HOME/.pulumi/bin

# AWS creds here - variables with $ to be set on gitlab var env
aws configure set default.region '$AWS_DEFAULT_REGION'
aws configure set aws_access_key_id '$AWS_ACCESS_KEY_ID'
aws configure set aws_secret_access_key '$AWS_SECRET_ACCESS_KEY'

echo $AWS_ACCESS_KEY_ID
echo $AWS_SECRET_ACCESS_KEY

pulumi stack select accure1/dev --cwd "/builds/accure1/code/el/corvus/infra/"

# preview configuration before deployment
pulumi preview --cwd "/builds/accure1/code/el/corvus/infra/"
b
are you provisioning docker containers, I can't see where you're referencing docker anywhere so no idea where that file not found is coming from
w
If your pulumi script is building docker container, you will need to make sure your build containers have docker installed.
docker in docker,
yes.
in our build container we install it in our
Dockerfile
with:
Copy code
# SETUP DOCKER
RUN curl -fsSL <https://get.docker.com> -o get-docker.sh
RUN sudo sh get-docker.sh
RUN sudo service docker start
depending on the base image your build container uses you may have to install
sudo
Copy code
RUN apt-get install sudo -y
a
thanks @white-secretary-18260 for that suggestion (in hindsight it was pretty obvious 🤦), it seems to have gotten me past the previous error. But now the pipelines hangs in the
pulumi preview
call 🤔 . Any ideas? Btw, the new
pulumiSetup/setup.sh
script that im using is (note the additional install docker lines):
Copy code
#!/bin/bash

# exit if a command returns a non-zero exit code
# print the commands and their args as they are executed
set -e -x

# Download and install required tools
# update the GitLab Runner and install other packages
apt-get update -y
apt-get install sudo python3-pip python3-venv unzip wget curl -y

# SETUP DOCKER
curl -fsSL <https://get.docker.com> -o get-docker.sh
sudo sh get-docker.sh
sudo service docker start

# INSTALL PULUMI
curl -fsSL <https://get.pulumi.com/> | bash
export PATH=$PATH:$HOME/.pulumi/bin
export PULUMI_ACCESS_TOKEN=$PULUMI_ACCESS_TOKEN

# Login into pulumi. This will require the PULUMI_ACCESS_TOKEN environment variable
# pulumi config set --secret pulumi-access-token $PULUMI_ACCESS_TOKEN
pulumi login

curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"
unzip -qq awscliv2.zip
sudo ./aws/install
w
I’d throw
Copy code
--verbose 999
on there and see what it brings.
a
apparently it wasn't hanging, but just took over 30 minutes to do the
pulumi preview
. I'm running it again now with the increased verbosity, so hopefully will have some more info soon. But anyway I guess I'll need to implement some sort of caching of the image getting built
👍 1