Qarik-Group / concourse-tutorial

Learn to use https://concourse-ci.org with this linear sequence of tutorials. Learn each concept that builds on the previous concept.
870 stars 554 forks source link

02 task inputs inputs_required #40

Closed jpic closed 7 years ago

jpic commented 8 years ago

Thanks for sharing this tutorial, it's really really cool !!!

There's a little problem with inputs_required in 02_task_inputs though:

07/03 2016 11:48:20 jpic@concourse ~/concourse-tutorial/02_task_inputs  (master)
$ fly -t tutorial execute -c no_inputs.yml
targeting http://localhost:8080

executing build 21
initializing with docker:///busybox
running ls -al
total 8
drwxr-xr-x    2 root     root          4096 Mar  7 11:48 .
drwxr-xr-x    3 root     root          4096 Mar  7 11:48 ..
succeeded

07/03 2016 11:48:28 jpic@concourse ~/concourse-tutorial/02_task_inputs  (master)
$ fly -t tutorial e -c inputs_required.yml -i some-important-input=.
targeting http://localhost:8080

executing build 22
container: start: exit status 2
errored
^C
aborting...

I'm a newbie and if at least you could give me some clues to debug this it would help a lot !

Thanks in advance

drnic commented 8 years ago

hmm, sorry I thought I tested this all for v0.74; but I did write section 02 when v0.73 was out. I'll debug/fix soon.

jpic commented 8 years ago

On Mon, Mar 7, 2016 at 10:17 PM, Dr Nic Williams notifications@github.com wrote:

hmm, sorry I thought I tested this all for v0.74; but I did write section 02 when v0.73 was out. I'll debug/fix soon.

Thanks !! If you'd like to copy / paste your debug session terminal somewhere I'd be happy to read it and learn. Anyway, I'm glad to know that it doesn't come from my setup :D

drnic commented 8 years ago

Hmm, I can't reproduce what you're seeing. Here's what I see:

$ fly -t tutorial e -c inputs_required.yml
targeting http://192.168.100.4:8080

error: missing required input `some-important-input`
$ fly -t tutorial e -c inputs_required.yml -i some-important-input=.
targeting http://192.168.100.4:8080

executing build 2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10240    0 10240    0     0  1732k      0 --:--:-- --:--:-- --:--:-- 2000k
initializing with docker:///busybox
running ls -alR
.:
total 8
drwxr-xr-x    3 root     root          4096 Mar  7 22:06 .
drwxr-xr-x    3 root     root          4096 Mar  7 22:06 ..
drwxr-xr-x    1 501      20             104 Mar  7 22:05 some-important-input

./some-important-input:
total 16
drwxr-xr-x    1 501      20             104 Mar  7 22:05 .
drwxr-xr-x    3 root     root          4096 Mar  7 22:06 ..
-rw-r--r--    1 501      20             112 Feb 28 00:51 input_parent_dir.yml
-rw-r--r--    1 501      20             118 Feb 28 00:51 inputs_required.yml
-rw-r--r--    1 501      20              79 Feb 28 00:51 no_inputs.yml
succeeded

Perhaps destroy and recreate your concourse-lite? cd .. && vagrant destroy -f && vagrant up?

jpic commented 8 years ago

Thanks a heap for checking, I'm not using vagrant, but concourse binaries on ubuntu vivid in the cloud: https://github.com/concourse/concourse/releases/download/v0.74.0/concourse_linux_amd64

I source this file:

export workdir=/etc/concourse

export session_key=$workdir/session-key
export tsa_key=$workdir/tsa-key
export worker_key=$workdir/worker-key

sudo mkdir -p $workdir
sudo chown $(whoami) $workdir

for key in $session_key $tsa_key $worker_key; do
  [ -e "$key" ] || ssh-keygen -N '' -t rsa -f "$key"
done

export concourse=$(which concourse)
if [ -z "$concourse" ]; then
  echo "'concourse' must be installed someplace in your \$PATH" >&2
  exit 1
fi

And then start the worker as such:

#!/bin/bash

set -eux

sudo $concourse worker \
  --work-dir $workdir \
  --tsa-port 2223 \
  --tsa-public-key ${tsa_key}.pub \
  --tsa-worker-private-key $worker_key \
  --peer-ip 127.0.0.1

And the web as such:

#!/bin/bash
set -e -u -x

exec $concourse web \
  --development-mode \
  --session-signing-key $session_key \
  --tsa-bind-port 2223 \
  --tsa-host-key $tsa_key \
  --tsa-authorized-keys ${worker_key}.pub

Other examples like 01 and no_input work as expected. Seems like I'll have to debug my setup. Would you share some of your insight for that purpose ?

drnic commented 8 years ago

Perhaps jump on http://slack.concourse.ci/ and chat with core team about debugging. Cool that you're trying to run it directly. Sorry I can't help.

On Tue, Mar 8, 2016 at 8:48 AM, James Pic notifications@github.com wrote:

Thanks a heap for checking, I'm not using vagrant, but concourse binaries on ubuntu vivid in the cloud:

https://github.com/concourse/concourse/releases/download/v0.74.0/concourse_linux_amd64

I source this file:

export workdir=/etc/concourse

export session_key=$workdir/session-key
export tsa_key=$workdir/tsa-key
export worker_key=$workdir/worker-key

sudo mkdir -p $workdir
sudo chown $(whoami) $workdir

for key in $session_key $tsa_key $worker_key; do
[ -e "$key" ] || ssh-keygen -N '' -t rsa -f "$key"
done

export concourse=$(which concourse)
if [ -z "$concourse" ]; then
echo "'concourse' must be installed someplace in your \$PATH" >&2
exit 1
fi

And then start the worker as such:

#!/bin/bash

set -eux

sudo $concourse worker \
--work-dir $workdir \
--tsa-port 2223 \
--tsa-public-key ${tsa_key}.pub \
--tsa-worker-private-key $worker_key \
--peer-ip 127.0.0.1

And the web as such:

#!/bin/bash
set -e -u -x

exec $concourse web \
--development-mode \
--session-signing-key $session_key \
--tsa-bind-port 2223 \
--tsa-host-key $tsa_key \
--tsa-authorized-keys ${worker_key}.pub

Other examples like 01 and no_input work as expected. Seems like I'll have to debug my setup. Would you share some of your insight for that purpose ?

— Reply to this email directly or view it on GitHub https://github.com/starkandwayne/concourse-tutorial/issues/40#issuecomment-193490964 .

Dr Nic Williams Stark & Wayne LLC - consultancy for Cloud Foundry users http://drnicwilliams.com http://starkandwayne.com cell +1 (415) 860-2185 twitter @drnic

mkb commented 7 years ago

@jpic Were you able to get help on the Concourse Slack chat? Are you still seeing this issue?

jpic commented 7 years ago

@mkb I don't remember, sorry !