vmware / nsx-t-datacenter-ci-pipelines

CI pipelines for VMware NSX-T Datacenter
Other
71 stars 43 forks source link

error: unknown target: nsx-concourse #18

Closed maldex closed 6 years ago

maldex commented 6 years ago

Gents, what am i doing wrong? Allthough i can get the container and supposedly the installer-application running and login as admin, i just can't see that install-nsx-t ressource. I bet it's something simple stupid, but what? Here's boiled-down what i tried:

### GLOBALS
export JmpIp=192.168.18.146 JmpDns=192.168.18.1 CONCOURSE_URL=http://${JmpIp}:8080        TERM=xterm

### docker stop and cleanup - also remove images
# remove everything, kill all containers and remove images
docker ps | awk '{if(NR>1)print $1}' | xargs docker stop
docker ps -a | awk '{if(NR>1)print $1}' | xargs docker rm
docker images -a | awk '{if(NR>1)print $3}' | xargs docker rmi

### reset concourse-home
sudo rm -rf /home/concourse
sudo mkdir /home/concourse
sudo setfacl -d -m u:`whoami`:rwX /home/concourse
sudo setfacl -R -m u:`whoami`:rwX /home/concourse
pushd /home/concourse
wget http://10.83.6.87/data/NSX-T/nsx-unified-appliance-2.3.0.0.0.10085405.ova
wget http://10.83.6.87/data/NSX-T/VMware-ovftool-4.3.0-7948156-lin.x86_64.bundle

# get configuration
#wget http://10.83.6.87/data/NSX-T/nsx_pipeline_config.yml  # customized PAS_and_PKS/nsx_pipeline_config.yml
wget https://raw.githubusercontent.com/vmware/nsx-t-datacenter-ci-pipelines/master/sample_parameters/PAS_and_PKS/nsx_pipeline_config.yml

# replace nsx_image_webserver entry with JmpIp
sed -i 's%^nsx_image_webserver:.*%nsx_image_webserver: "http://'${JmpIp}':40001"%g' nsx_pipeline_config.yml
popd

### prepare: fetch pre-build 'nsx-t-install'-image 
wget -qO- https://github.com/vmware/nsx-t-datacenter-ci-pipelines/raw/master/docker_image/nsx-t-install-09122018.tar | docker load

### or prepare: Clone and build local 'nsx-t-install'-image (rather than download prebuild.tar)
#cd ~; rm -rf ~/nsx-t-datacenter-ci-pipelines/
#git clone https://github.com/vmware/nsx-t-datacenter-ci-pipelines.git
#pushd ~/nsx-t-datacenter-ci-pipelines/docker_image
#docker build -t nsx-t-install .
#popd

### run the whole thing
export TERM=dumb
docker run --name nsx-t-installer -it \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /home/concourse:/home/concourse \
  -e CONCOURSE_URL=${CONCOURSE_URL} \
  -e EXTERNAL_DNS=${JmpDns} \
  -e IMAGE_WEBSERVER_PORT=40001 \
  -e VMWARE_USER='a@b.c' \
  -e VMWARE_PASSWORD='none' \
  -e NSXT_VERSION=2.3.0 \
  nsx-t-install | tee out.log

what i got:

user@sisyphos:/home/concourse$ export TERM=dumb
user@sisyphos:/home/concourse$ docker run --name nsx-t-installer -it \
>   -v /var/run/docker.sock:/var/run/docker.sock \
>   -v /home/concourse:/home/concourse \
>   -e CONCOURSE_URL=${CONCOURSE_URL} \
>   -e EXTERNAL_DNS=${JmpDns} \
>   -e IMAGE_WEBSERVER_PORT=40001 \
>   -e VMWARE_USER='a@b.c' \
>   -e VMWARE_PASSWORD='none' \
>   -e NSXT_VERSION=2.3.0 \
>   nsx-t-install | tee out.log
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
... pull output ...
Status: Downloaded newer image for nginx:latest
859b9dff5c2c1eead8ad21af549f1a38c9acde8eeb8563309cbee7711fc3c1d4
Cloning into 'concourse-docker'...
remote: Enumerating objects: 347, done.
remote: Total 347 (delta 0), reused 0 (delta 0), pack-reused 347
Receiving objects: 100% (347/347), 56.88 KiB | 576.00 KiB/s, done.
Resolving deltas: 100% (184/184), done.
Cloning into 'nsx-t-datacenter-ci-pipelines'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 240 (delta 18), reused 23 (delta 11), pack-reused 193
Receiving objects: 100% (240/240), 407.87 KiB | 1.39 MiB/s, done.
Resolving deltas: 100% (101/101), done.
+ mkdir -p keys/web keys/worker
+ yes
+ ssh-keygen -t rsa -f ./keys/web/tsa_host_key -N ''
Generating public/private rsa key pair.
Your identification has been saved in ./keys/web/tsa_host_key.
Your public key has been saved in ./keys/web/tsa_host_key.pub.
... rsa-fingerprint ...
+ yes
+ ssh-keygen -t rsa -f ./keys/web/session_signing_key -N ''
Generating public/private rsa key pair.
Your identification has been saved in ./keys/web/session_signing_key.
Your public key has been saved in ./keys/web/session_signing_key.pub.
... rsa-fingerprint ...
+ yes
+ ssh-keygen -t rsa -f ./keys/worker/worker_key -N ''
Generating public/private rsa key pair.
Your identification has been saved in ./keys/worker/worker_key.
Your public key has been saved in ./keys/worker/worker_key.pub.
... rsa-fingerprint ...
+ cp ./keys/worker/worker_key.pub ./keys/web/authorized_worker_keys
+ cp ./keys/web/tsa_host_key.pub ./keys/worker
bringing up Concourse server in a docker-compose cluster
Unable to find image 'docker/compose:1.21.2' locally
1.21.2: Pulling from docker/compose
... pull output ...
Status: Downloaded newer image for docker/compose:1.21.2
Pulling concourse-db (postgres:)...
latest: Pulling from library/postgres
... pull output ...
Status: Downloaded newer image for postgres:latest
Pulling concourse-web (concourse/concourse:3.14.1)...
3.14.1: Pulling from concourse/concourse
... pull output ...
Status: Downloaded newer image for concourse/concourse:3.14.1
Creating concourse_concourse-db_1 ... done
Creating concourse_concourse-web_1 ... done
Creating concourse_concourse-worker_1 ... done
waiting for Concourse web server to be running
waiting for Concourse web server to be running
waiting for Concourse web server to be running
brought up the Concourse cluster
logging into concourse at http://192.168.18.146:8080
error: unknown target: nsx-concourse
logging in to team 'main'

target saved
setting the NSX-t install pipeline nsx-t-install
groups:
  group full-install-config has been added:
+ name: full-install-config
+ jobs:
+ - install-nsx-t
+ - add-nsx-t-routers
+ - config-nsx-t-extras

  group install-nsx-t has been added:
+ name: install-nsx-t
+ jobs:
+ - standalone-install-nsx-t

  group add-nsx-t-routers has been added:
+ name: add-nsx-t-routers
+ jobs:
+ - standalone-add-nsx-t-routers

  group config-nsx-t-extras has been added:
+ name: config-nsx-t-extras
+ jobs:
+ - standalone-config-nsx-t-extras

resources:
  resource nsx-t-gen-pipeline has been added:
+ name: nsx-t-gen-pipeline
+ type: git
+ source:
+   branch: master
+   params:
+     disable_git_lfs: true
+   uri: https://github.com/vmware/nsx-t-datacenter-ci-pipelines.git

  resource nsxt-ansible has been added:
+ name: nsxt-ansible
+ type: git
+ source:
+   branch: master
+   uri: https://github.com/vmware/ansible-for-nsxt.git

  resource ovftool has been added:
+ name: ovftool
+ type: file-url
+ source:
+   filename: VMware-ovftool-4.3.0-7948156-lin.x86_64.bundle
+   skip_ssl_verification: true
+   url: http://192.168.18.146:40001/VMware-ovftool-4.3.0-7948156-lin.x86_64.bundle

resource types:
  resource type file-url has been added:
+ name: file-url
+ type: docker-image
+ source:
+   repository: pivotalservices/concourse-curl-resource
+   tag: latest

jobs:
  job install-nsx-t has been added:
+ name: install-nsx-t
+ ... loads of further output ...

  job add-nsx-t-routers has been added:
+ name: add-nsx-t-routers
+ ... loads of further output ...

  job config-nsx-t-extras has been added:
+ name: config-nsx-t-extras
+ ... loads of further output ...

  job standalone-install-nsx-t has been added:
+ name: standalone-install-nsx-t
+ ... loads of further output ...

  job standalone-config-nsx-t-extras has been added:
+ name: standalone-config-nsx-t-extras
+ ... loads of further output ...

bailing out
unpausing the pipepline nsx-t-install
pipeline 'nsx-t-install' not found

cheers

maldex commented 6 years ago

In run.sh for docker: fly login must happen before fly sync, and there's a new --non-interactive switch. Will create a PR soon.

kais66 commented 6 years ago

Thanks @maldex. I checked on my env and indeed I was seeing the same error message about fly sync. The ordering needs to be corrected.

It probably is not the cause of why you were not able to see the pipeline though. Could you check the output of docker ps -a and see if all three concourse containers are running?

maldex commented 6 years ago

I think the --non-interactive switch made the difference, i can see concourse, postgres and that nginx containers now, and also access the pipeline within the concourse-web-ui. So far all good. Created a PR that addresses somewhat a bit more. Just pick the good stuff and reject the rest. Thanks for your work.