nitrictech / cli

Nitric CLI. Manage and run Nitric apps locally and deploy to any cloud.
https://nitric.io
Apache License 2.0
26 stars 10 forks source link

GitLab pipelines issue running nitric up on shared runners #769

Closed davemooreuws closed 3 months ago

davemooreuws commented 3 months ago

Bug Report

Issue

On GitLab pipelines, with shared runners there are issues connecting to the containers.

Steps

Steps to reproduce the behavior:

With latest docker (27~) there are connection errors.

deploy:
  image: docker:latest
  services:
    - docker:dind
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  variables:
    PULUMI_CONFIG_PASSPHRASE: $PULUMI_ACCESS_TOKEN
    PULUMI_ACCESS_TOKEN: $PULUMI_ACCESS_TOKEN
    AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

  before_script:
    - apk update && apk add --no-cache curl bash
    - curl -L https://nitric.io/install?version=latest | bash
    - export PATH=$PATH:$HOME/.nitric/bin
    - curl -fsSL https://get.pulumi.com/ | bash
    - export PATH=$PATH:$HOME/.pulumi/bin
  script:
    - nitric up --ci

With docker in docker recommended version docker (24~) there are resources that are not deployed. (i.e. API gateway)

deploy:
  image: docker:24.0.5
  services:
    - docker:24.0.5-dind
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  variables:
    PULUMI_CONFIG_PASSPHRASE: $PULUMI_ACCESS_TOKEN
    PULUMI_ACCESS_TOKEN: $PULUMI_ACCESS_TOKEN
    AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY

  before_script:
    - apk update && apk add --no-cache curl bash
    - curl -L https://nitric.io/install?version=latest | bash
    - export PATH=$PATH:$HOME/.nitric/bin
    - curl -fsSL https://get.pulumi.com/ | bash
    - export PATH=$PATH:$HOME/.pulumi/bin
  script:
    - nitric up --ci

I have also tried adding these variables, which do not fix any of the above:

DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""

Expected

It should work.

Environment and setup information

Other info

Errors with latest docker: image

False success with docker 24 (missing API gateway output/deployment): image

davemooreuws commented 3 months ago

I have done some investigating and the WSL fix of using the eth0 interface IP does fix this issue. Does require some testing, see PR

nitric-bot commented 3 months ago

:tada: This issue has been resolved in version 1.50.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: