Anyone using Smuggler Resource with v4.2.1?


#1

Hello,

I wonder, is anyone successfully using the Smuggler Resource with Concourse v4.2.1?

I’ve encountered some difficulties defining a pipeline, in particular the Smuggler Params are being rejected (because I presume they are not included in the YAML schema and hence the pipeline fails validation). Will research a little further tomorrow, but appreciate if someone know that it works, or does not work.

Thanks, Tim.


#2

This in the output when trying to load the example Pipeline (from the Smuggler readme):

resources:
  resource random_number_generator has been added:
+ name: random_number_generator
+ type: smuggler
+ source:
+   commands:
+     check: |
+       echo "${RANDOM}" > ${SMUGGLER_OUTPUT_DIR}/versions
+     in: |
+       echo "${SMUGGLER_VERSION_ID}" > \
+         ${SMUGGLER_DESTINATION_DIR}/${SMUGGLER_target_file}
+       echo "date=$(date)" > ${SMUGGLER_OUTPUT_DIR}/metadata
+   smuggler_debug: true
+   target_file: random_number_file

resource types:
  resource type smuggler has been added:
+ name: smuggler
+ type: docker-image
+ source:
+   repository: redfactorlabs/concourse-smuggler-resource
+   tag: alpine

jobs:
  job some_job has been added:
+ name: some_job
+ plan:
+ - get: random_number_generator
+   trigger: true
+ - task: print_the_number
+   config:
+     platform: linux
+     image_resource:
+       type: docker-image
+       source:
+         repository: alpine
+     run:
+       path: sh
+       args:
+       - -ec
+       - |
+         cat random_number_generator/my_random_number_file
+     inputs:
+     - name: random_number_generator
      params:
          target_file: my_random_number_file

error: invalid configuration:
unknown/extra keys:
  - jobs[0].plan[1].config.inputs[0].params

OK, that looks like something wrong with the target_file parameter in the params.

Is something missing to make this work with v4.2.1 …


#3

And some progress :grinning:

It seems that if I move the params from the plan/task/config/Input/params up into the plan/get/params then the whole mechanism is working. This is the edited snippet:

jobs:
# A example job using our new resource
- name: some_job
  plan:
  - get: random_number_generator
    trigger: true
    params:
     target_file: my_random_number_file    <<<==== Moved params to here.
  - task: print_the_number
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: alpine
      inputs:
      - name: random_number_generator
#        params:
#          target_file: my_random_number_file
      run:
        path: sh
        args:
        - -ec
        - |
          ls random_number_generator/my_random_number_file
          cat random_number_generator/my_random_number_file

That’s good enough for me.