How can I use pulumi non-interactively, e.g. in a ...
# general
e
How can I use pulumi non-interactively, e.g. in a gitlab CI pipeline?
c
@early-musician-41645
pulumi up --non-interactive
should do the trick
unless I misunderstand your question.
e
what about login?
or setting credentials for automation runs?
w
You can set
PULUMI_ACCESS_TOKEN
to avoid need for interactive login. See https://pulumi.io/reference/cli/pulumi_login.html.
See also https://pulumi.io/reference/cd-travis.html (and other similar docs for other CI systems) for more E2E guidance on this.
e
My goal is to have automated tests for EKS cluster creation. I'd like to: a) Spin up a new cluster with
pulumi up
b) Run a set of tests against that clsuter c) Destroy the cluster with
pulumi destroy
I'll try the things listed in thread, thanks!
@creamy-potato-29402 Any idea what's going on here? I've installed pulumi into a Docker image. When I connect into a container and run pulumi I see this:
Copy code
=== Upgrading Pulumi  to v0.16.11 ===
+ Downloading <https://get.pulumi.com/releases/sdk/pulumi-v0.16.11-linux-x64.tar.gz>...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 36.8M  100 36.8M    0     0  17.4M      0  0:00:02  0:00:02 --:--:-- 17.4M
+ Extracting to /root/.pulumi/bin

=== Pulumi is now installed! � ===
+ If you're new to Pulumi, here are some resources for getting started:
      - Getting Started Guide: <https://pulumi.io/quickstart>
      - Examples Repo: <https://github.com/pulumi/examples>
      - Create a New Project: Run 'pulumi new' to create a new project using a template
bash-4.4# pulumi
bash: /root/.pulumi/bin/pulumi: No such file or directory
bash-4.4# ls -l /root/.pulumi/bin/
total 96152
-rwxr-xr-x    1 root     root      40037875 Jan 24 22:19 pulumi
-rwxr-xr-x    1 root     root      19464658 Jan 24 22:19 pulumi-language-go
-rwxr-xr-x    1 root     root      19481356 Jan 24 22:19 pulumi-language-nodejs
-rwxr-xr-x    1 root     root      19454953 Jan 24 22:19 pulumi-language-python
-rw-r--r--    1 root     root          4734 Jan 24 22:19 pulumi-language-python-exec
-rwxr-xr-x    1 root     root           238 Jan 24 22:19 pulumi-resource-pulumi-nodejs
@white-balloon-205? Is there something special with pulumi installed in containers?
w
Huh - that's strange - what happens if you run
/root/.pulumi/bin/pulumi
?
e
same error
Here's the Dockerfile:
Copy code
FROM <http://artifactory.prod.tableautools.com:6555/sdp/tas/mustang-runner:master-617562|artifactory.prod.tableautools.com:6555/sdp/tas/mustang-runner:master-617562>

RUN addgroup -g 11199 appuser && \
    adduser -D -u 11198 -h /home/appuser -s /bin/bash -G appuser appuser
USER appuser

WORKDIR /home/appuser

RUN curl -fsSL <https://get.pulumi.com> | sh

ENV SCRIPT_DIR /opt/test/bin
ENV PATH $SCRIPT_DIR/:/home/appuser/.pulumi/bin:$PATH

RUN git clone <https://gitlab.tableausoftware.com/service-delivery-platform/mustang/sdp-mustang-terraform.git>
COPY bin/* $SCRIPT_DIR/
Copy code
$ which pulumi
/home/appuser/.pulumi/bin/pulumi

bash-4.4$ ls -l /home/appuser/.pulumi/bin/
total 96152
-rwxr-xr-x    1 appuser  appuser   40037875 Jan 24 22:36 pulumi
-rwxr-xr-x    1 appuser  appuser   19464658 Jan 24 22:36 pulumi-language-go
-rwxr-xr-x    1 appuser  appuser   19481356 Jan 24 22:36 pulumi-language-nodejs
-rwxr-xr-x    1 appuser  appuser   19454953 Jan 24 22:36 pulumi-language-python
-rw-r--r--    1 appuser  appuser       4734 Jan 24 22:36 pulumi-language-python-exec
-rwxr-xr-x    1 appuser  appuser        238 Jan 24 22:36 pulumi-resource-pulumi-nodejs

bash-4.4$ /home/appuser/.pulumi/bin/pulumi
bash: /home/appuser/.pulumi/bin/pulumi: No such file or directory
Copy code
$ ldd /home/appuser/.pulumi/bin/pulumi
        /lib64/ld-linux-x86-64.so.2 (0x7fee313d3000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fee313d3000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fee313d3000)
w
For my ability to try to recreate this - what flavor of Linux is the base image here coming from? (When I try a ubunu base some of the
addgroup
flags aren't valid)
e
FROM docker:18.09-git
@white-balloon-205 Also repros if I run this inside the container:
Copy code
bash-4.4$ wget  <https://get.pulumi.com/releases/sdk/pulumi-v0.16.11-linux-x64.tar.gz>
Connecting to <http://get.pulumi.com|get.pulumi.com> (13.33.151.206:443)
pulumi-v0.16.11-linu 100% |******************************************************************************************************************************************************************| 37730k  0:00:00 ETA
bash-4.4$ tar -zxvf pulumi-v0.16.11-linux-x64.tar.gz
pulumi/
pulumi/pulumi-language-python-exec
pulumi/pulumi-resource-pulumi-nodejs
pulumi/pulumi-language-python
pulumi/pulumi-language-go
pulumi/pulumi-language-nodejs
pulumi/pulumi
bash-4.4$ cd pulumi
bash-4.4$ ls
pulumi                         pulumi-language-go             pulumi-language-nodejs         pulumi-language-python         pulumi-language-python-exec    pulumi-resource-pulumi-nodejs
bash-4.4$ ./pulumi
bash: ./pulumi: No such file or directory
bash-4.4$ ls -l
total 96152
-rwxr-xr-x    1 appuser  appuser   40037875 Jan 17 01:02 pulumi
-rwxr-xr-x    1 appuser  appuser   19464658 Jan 17 01:02 pulumi-language-go
-rwxr-xr-x    1 appuser  appuser   19481356 Jan 17 01:02 pulumi-language-nodejs
-rwxr-xr-x    1 appuser  appuser   19454953 Jan 17 01:02 pulumi-language-python
-rw-r--r--    1 appuser  appuser       4734 Jan 17 01:02 pulumi-language-python-exec
-rwxr-xr-x    1 appuser  appuser        238 Jan 17 01:02 pulumi-resource-pulumi-nodejs
Repros on
centos:7
too
w
Hmm - I can't repro this:
Copy code
$ docker run -it centos:7
[root@2b0632618abb /]#  curl -fsSL <https://get.pulumi.com> | sh
=== Installing Pulumi v0.16.11 ===
+ Downloading <https://get.pulumi.com/releases/sdk/pulumi-v0.16.11-linux-x64.tar.gz>...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 36.8M  100 36.8M    0     0  2034k      0  0:00:18  0:00:18 --:--:-- 2076k
+ Extracting to /root/.pulumi/bin
+ Adding $HOME/.pulumi/bin to $PATH in /root/.bashrc

=== Pulumi is now installed! 🍹 ===
+ Please restart your shell or add add /root/.pulumi/bin to your $PATH
+ If you're new to Pulumi, here are some resources for getting started:
      - Getting Started Guide: <https://pulumi.io/quickstart>
      - Examples Repo: <https://github.com/pulumi/examples>
      - Create a New Project: Run 'pulumi new' to create a new project using a template
[root@2b0632618abb /]# ~/.pulumi/bin/pulumi version
v0.16.11
e
I guess it's the base image difference:
Copy code
$ docker run -it docker:18.09-git
/ # apk add curl
fetch <http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz>
fetch <http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz>
(1/1) Installing curl (7.61.1-r1)
Executing busybox-1.28.4-r1.trigger
OK: 22 MiB in 23 packages
/ # curl -fsSL <https://get.pulumi.com> | sh
=== Installing Pulumi v0.16.11 ===
+ Downloading <https://get.pulumi.com/releases/sdk/pulumi-v0.16.11-linux-x64.tar.gz>...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 36.8M  100 36.8M    0     0  29.1M      0  0:00:01  0:00:01 --:--:-- 29.1M
+ Extracting to /root/.pulumi/bin

=== Pulumi is now installed! � ===
+ Please add /root/.pulumi/bin to your $PATH
+ If you're new to Pulumi, here are some resources for getting started:
      - Getting Started Guide: <https://pulumi.io/quickstart>
      - Examples Repo: <https://github.com/pulumi/examples>
      - Create a New Project: Run 'pulumi new' to create a new project using a template
/ # ~/.pulumi/bin/pulumi
sh: /root/.pulumi/bin/pulumi: not found
Also fails in
alpine:3.7
Found a fix:
Copy code
apk add --no-cache \
        perl \
        wget \
        openssl \
        ca-certificates \
        libc6-compat \
        libstdc++
...

/ # ~/.pulumi/bin/pulumi version
v0.16.11
I think it's the dynamic loading of missing libs in those alpine base images
w
Ahh - yes - see https://github.com/pulumi/pulumi/issues/1986 - I think
libc6-compat
is a requirement.
e
okay, thanks.