Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow variable contents are not preserved in docker-composed tasks #404

Closed
mbenguig opened this issue Aug 10, 2017 · 3 comments
Closed

Comments

@mbenguig
Copy link
Member

In a docker-compose task

  • I set a variable product_list with liste.txt as value
  • I set a variable product_list_ajusted with liste_ajustee.txt as value

I create a docker-compose task calling these variables

Now $product_list => liste.txt and $product_list_ajusted => liste.txt_ajusted

@tobwiens
Copy link
Contributor

@mbenguig
Can you show the docker-compose task?

The variables should be access through $variables_product_list -> .... Because the variables are pushed to the bash which execute docker-compose. Docker compose has it's own way to process bash variables.

Furhtermore, ProActive docker-compose script engine replaces variables inside the docker-compose script. There is a blog post about it: http://blog.activeeon.com/2015/04/proactive-and-docker-schedule-and.html

@tobwiens
Copy link
Contributor

Consider this xml file with variable substitution

<?xml version="1.0" encoding="UTF-8"?>
<job
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:proactive:jobdescriptor:3.8"
     xsi:schemaLocation="urn:proactive:jobdescriptor:3.8 http://www.activeeon.com/public_content/schemas/proactive/jobdescriptor/3.8/schedulerjob.xsd"
    name="Untitled workflow" 
    priority="normal"
    onTaskError="continueJobExecution"
     maxNumberOfExecution="2"
>
  <variables>
    <variable name="output_variable" value="-------------VARIABLES WORK!---------------" />
  </variables>
  <description>
    <![CDATA[ A workflow which runs a docker compose script ]]>
  </description>
  <taskFlow>
    <task name="Docker-Compose-Task">
      <description>
        <![CDATA[ Simple hello world with docker-compose script engine. ]]>
      </description>
      <scriptExecutable>
        <script>
          <code language="docker-compose">
            <![CDATA[
ubuntuEcho:
  image: ubuntu
  command: /bin/bash -c 'sleep 5 && echo "$output_variable" '
]]>
          </code>
        </script>
      </scriptExecutable>
    </task>
  </taskFlow>
</job>

@mbenguig
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants