Repository 'tool_factory_2'
hg clone https://toolshed.g2.bx.psu.edu/repos/fubar/tool_factory_2

Changeset 46:f8700bed1e17 (2020-08-18)
Previous changeset 45:668c37cc8962 (2020-08-16) Next changeset 47:e95d9fe5ab50 (2020-08-23)
Commit message:
Uploaded
modified:
toolfactory/docker/Dockerfile
toolfactory/rgToolFactory2.py
toolfactory/rgToolFactory2.xml
added:
toolfactory/docker/postinstall.py
toolfactory/docker/tfwelcome.html
b
diff -r 668c37cc8962 -r f8700bed1e17 toolfactory/docker/Dockerfile
--- a/toolfactory/docker/Dockerfile Sun Aug 16 20:05:19 2020 -0400
+++ b/toolfactory/docker/Dockerfile Tue Aug 18 08:25:43 2020 -0400
[
@@ -3,44 +3,50 @@
 # VERSION       0.2
 # patches startup so the below will install a workflow dropped into $GALAXY_ROOT/workflows
 # use docker run -p 8080:80  -d -e GALAXY_AUTO_UPDATE_WORKFLOWS=/galaxy-central/workflows/TF_sample_wf.ga -v /home/ubuntu/galaxy_storage/:/export/  toolfactory
-FROM bgruening/galaxy-stable
+FROM quay.io/bgruening/galaxy:20.05
 MAINTAINER Ross Lazarus ross.lazarus@gmail.com
 
 ENV GALAXY_CONFIG_BRAND=ToolFactory
 ENV GALAXY_LOGGING="full"
-
-# RUN apt-get update -y && apt-get install -y build-essential gcc apt-utils
-# needed for planemo build
-
-RUN /galaxy_venv/bin/python -m pip install --upgrade pip
-# RUN /galaxy_venv/bin/python -m pip install planemo
-
+ADD tfwelcome.html /export/welcome.html
 # RUN add-tool-shed --url 'http://testtoolshed.g2.bx.psu.edu/' --name 'Test Tool Shed'
-ADD my_tool_list.yml $GALAXY_ROOT/config/toolfactory_tools.yaml
-ENV GALAXY_AUTO_UPDATE_TOOLS=$GALAXY_ROOT/config/toolfactory_tools.yaml
+RUN mkdir -p /tftools \
+  && mkdir -p /tftools/toolfactory \
+  && mkdir -p /tftools/planemo_test
+
+ADD ./tftools/toolfactory /tftools/toolfactory
+ADD ./tftools/tf_tool_conf.xml /tftools/tf_tool_conf.xml
+ADD ./tftools/planemo_test /tftools/planemo_test
+ADD TF_example_wf.ga /tftools/TF_example_wf.ga
 
+ADD my_tool_list.yml /tftools/toolfactory_tools.yaml
+
+ENV GALAXY_AUTO_UPDATE_TOOLS=/tftools/toolfactory_tools.yaml
+# NOTE above does work but takes 1-2 minutes
+
+# ENV GALAXY_CONFIG_TOOL_CONFIG_FILE=config/tool_conf.xml.sample,config/tf_tool_conf.xml,config/shed_tool_conf.xml.sample
+#ENV GALAXY_CONFIG_TOOL_CONFIG_FILE=/tftools/tf_tool_conf.xml,config/tool_conf.xml.sample
+# works but does not install dependencies
 # Add workflows to the Docker image
-RUN mkdir -p $GALAXY_ROOT/workflows
-ADD TF_example_wf.ga $GALAXY_ROOT/workflows/TF_example_wf.ga
+
+ENV $GALAXY_DEFAULT_ADMIN_USER="admin"
+# ensure triggering post-start-actions.sh
+
+ADD tftools/datatypes_conf.xml $GALAXY_ROOT/conf/datatypes_conf.xml.sample
 ADD post-start-actions.sh /export/post-start-actions.sh
+ADD post-start-actions.sh $GALAXY_ROOT/config/post-start-actions.sh
+
 RUN chmod a+xr /export/post-start-actions.sh \
- && chmod a+xr $GALAXY_ROOT/workflows/TF_example_wf.ga 
-
+ && chmod a+xr /tftools/TF_example_wf.ga \
+ && chmod a+xr $GALAXY_ROOT/config/post-start-actions.sh
 # Add Galaxy interactive tours
 # ADD ./rna-workbench-tours/* $GALAXY_ROOT/config/plugins/tours/
 # Add data library definition file
 # ADD library_data.yaml $GALAXY_ROOT/library_data.yaml
-# cleanup dance
-RUN apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && rm -rf ~/.cache/ \
-    && find $GALAXY_ROOT/ -name '*.pyc' -delete | true \
-    && find /usr/lib/ -name '*.pyc' -delete | true \
-    && find /var/log/ -name '*.log' -delete | true \
-    && find $GALAXY_VIRTUAL_ENV -name '*.pyc' -delete | true \
-    && rm -rf /tmp/* /root/.cache/ /var/cache/* $GALAXY_ROOT/client/node_modules/ $GALAXY_VIRTUAL_ENV/src/ /home/galaxy/.cache/ /home/galaxy/.npm
-ENV GALAXY_DEFAULT_ADMIN_USER=''
-VOLUME ["/export/"]
+
+VOLUME ["/export/", "/data/", "/var/lib/docker"]
 EXPOSE :80
 EXPOSE :21
 EXPOSE :8800
+
 CMD ["/usr/bin/startup"]
-
b
diff -r 668c37cc8962 -r f8700bed1e17 toolfactory/docker/postinstall.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/docker/postinstall.py Tue Aug 18 08:25:43 2020 -0400
b
@@ -0,0 +1,6 @@
+from bioblend import galaxy
+
+gi = galaxy.GalaxyInstance(url='http://127.0.0.1:8080', key='fbdd3c2eecd191e88939fffc02eeeaf8')
+
+hl = gi.histories.get_histories()
+h = get_most_recently_used_history()
b
diff -r 668c37cc8962 -r f8700bed1e17 toolfactory/docker/tfwelcome.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/toolfactory/docker/tfwelcome.html Tue Aug 18 08:25:43 2020 -0400
[
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <link rel="stylesheet" href="/static/style/base.css" type="text/css" />
+</head>
+<body style="margin: 0">
+
+    <div class="jumbotron">
+        <div class="container">
+            <table><tr><td>
+            <h2>Hello, your <strong>Galaxy ToolFactory Docker</strong> container is running!</h2>
+            <strong>If you have not already done so, </strong>
+            From a handy linux console, please use <br>
+            <code>docker ps</code><br>
+            to find this container's name then use<br>
+            <code>docker exec [container name] config/post-start-actions.sh</code>
+            <br>
+            to load the sample tool generators to fully populate this container.
+            until the Dockerfile for this container figures out how to load a workflow during the build correctly.<br>
+            To run the workflow you need two small datasets until I get them loaded<br>
+            phiX.fasta from the Galaxy test-sample directory, and any smallish text file you want such as a readme or script.<br>
+            When you run the workflow, feed the fasta where it says, and the text file where you see rgToolFactory.py<br>
+            Send it to the same history and let it run.<br>
+            With any luck, you will have a history of examples to play with - use the rerun button to repopulate the ToolFactory form to illustrate<br>
+            positional and argparse style parameter passing for python, a simple bash script using STDIN/STDOUT and the perl (ugh) example from planemo<br>
+            <a target="_blank" href="https://wiki.galaxyproject.org/Admin/Config" class="btn btn-primary btn-lg">Configuring Galaxy »</a>
+            <a target="_blank" href="https://wiki.galaxyproject.org/Admin/Tools/AddToolFromToolShedTutorial" class="btn btn-primary btn-lg">Installing Tools »</a>
+            <a target="_parent" href="/tours/core.galaxy_ui" class="btn btn-primary btn-lg">Guided Tour »</a>
+            </td><td>
+                <div align=center>
+                    <img src="./welcome_image.png" width="90%" height="90%" />
+                </div>
+
+        </td></tr></table>
+        </div>
+    </div>
+
+    <div class="container">
+
+        <p class="lead">
+            <a target="_blank" class="reference" href="http://galaxyproject.org/">
+            Galaxy</a> is an open platform for supporting data intensive
+            research. Galaxy is developed by <a target="_blank" class="reference" href="http://wiki.galaxyproject.org/GalaxyTeam">The Galaxy Team</a>
+            with the support of  <a target="_blank" class="reference" href="https://github.com/galaxyproject/galaxy/blob/dev/CONTRIBUTORS.md">many contributors</a>.
+            The Galaxy Docker project is supported by the University of Freiburg, part of de.NBI.
+        </p>
+
+        <footer>
+            The <a target="_blank" class="reference" href="http://galaxyproject.org/">Galaxy Project</a>
+            is supported in part by <a target="_blank" class="reference" href="http://www.genome.gov">NHGRI</a>,
+            <a target="_blank" class="reference" href="http://www.nsf.gov">NSF</a>,
+            <a target="_blank" class="reference" href="http://www.huck.psu.edu">The Huck Institutes of the Life Sciences</a>,
+            <a target="_blank" class="reference" href="http://www.ics.psu.edu">The Institute for CyberScience at Penn State</a>,
+            and <a target="_blank" class="reference" href="http://www.jhu.edu/">Johns Hopkins University</a>.
+        </footer>
+
+    </div>
+
+</body>
+</html>
b
diff -r 668c37cc8962 -r f8700bed1e17 toolfactory/rgToolFactory2.py
--- a/toolfactory/rgToolFactory2.py Sun Aug 16 20:05:19 2020 -0400
+++ b/toolfactory/rgToolFactory2.py Tue Aug 18 08:25:43 2020 -0400
[
@@ -173,10 +173,17 @@
         self.testparam = []
         if (
             self.args.runmode == "Executable" or self.args.runmode == "system"
-        ):  # binary - no need
-            aCL(self.args.exe_package)  # this little CL will just run
+        ): 
+            if len(self.args.cl_override) > 0:
+                for x in self.args.cl_override.split(' '):
+                    aCL(x)
+            else:
+                aCL(self.args.exe_package)  # this little CL will just run
         else:
             self.prepScript()
+            aCL(self.args.interpreter_name)
+            aCL(self.sfile)
+
         self.elog = "%s_error_log.txt" % self.tool_name
         self.tlog = "%s_runner_log.txt" % self.tool_name
 
@@ -231,7 +238,6 @@
                 self.clargparse()
 
     def prepScript(self):
-        aCL = self.cl.append
         rx = open(self.args.script_path, "r").readlines()
         rx = [x.rstrip() for x in rx]
         rxcheck = [x.strip() for x in rx if x.strip() > ""]
@@ -255,9 +261,9 @@
             artifact.write(bytes("#!/usr/bin/env python\n", "utf8"))
         artifact.write(bytes(self.script, "utf8"))
         artifact.close()
-        aCL(self.args.interpreter_name)
-        aCL(self.sfile)
-
+        
+        
+        
     def cleanuppar(self):
         """ positional parameters are complicated by their numeric ordinal"""
         for i, p in enumerate(self.infiles):
@@ -482,7 +488,10 @@
         Uses galaxyhtml
         Hmmm. How to get the command line into correct order...
         """
-        self.tool.command_line_override = self.xmlcl
+        if self.args.cl_override:
+            self.tool.command_line_override = self.args.cl_override.split(' ') + self.xmlcl
+        else:
+            self.tool.command_line_override = self.xmlcl
         if self.args.interpreter_name:
             self.tool.interpreter = self.args.interpreter_name
         if self.args.help_text:
@@ -499,6 +508,13 @@
         requirements = gxtp.Requirements()
 
         if self.args.interpreter_name:
+            if self.args.dependencies:
+                for d in self.args.dependencies.split(','):
+                    requirements.append(
+                        gxtp.Requirement(
+                         "package", d, ""
+                        )
+                    )
             if self.args.interpreter_name == "python":
                 requirements.append(
                     gxtp.Requirement(
@@ -691,6 +707,8 @@
     parser = argparse.ArgumentParser()
     a = parser.add_argument
     a("--script_path", default="")
+    a("--dependencies", default="")
+    a("--cl_override", default="")
     a("--tool_name", default=None)
     a("--interpreter_name", default=None)
     a("--interpreter_version", default=None)
b
diff -r 668c37cc8962 -r f8700bed1e17 toolfactory/rgToolFactory2.xml
--- a/toolfactory/rgToolFactory2.xml Sun Aug 16 20:05:19 2020 -0400
+++ b/toolfactory/rgToolFactory2.xml Tue Aug 18 08:25:43 2020 -0400
b
@@ -92,10 +92,11 @@
         </repeat>
      </xml>
      <xml name="builtin_dynpar">
-          <param name="interpreter_version" type="text" value=""
-          label="Specific interpreter version to match dependency (Conda) repositories - e.g. for python '3.8.5' Latest if empty"/>
-            <param name="exe_package_version" type="text" value=""
-              label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty"/>
+            <param name="exe_package" type="hidden" value="" />
+            <param name="exe_package_version" type="hidden" value="" />
+            <param name="cl_override" type="hidden" value="" />
+            <param name="interpreter_version" type="hidden" value=""/>
+            <param name="dependencies" type="hidden" value="" />
           <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="Script goes here" area="True"
               help="If there are parameters, either positional or argparse style, the script must parse and use them appropriately">
               <sanitizer>
@@ -106,10 +107,12 @@
           </param>
     </xml>
     <xml name="dynpar">
+            <param name="exe_package" type="hidden" value="" />
+            <param name="exe_package_version" type="hidden" value="" />
+            <param name="cl_override" type="hidden" value="" />
+            <param name="dependencies" type="text" value="" label="List additional dependencies - e.g. 'planemo, ephemeris'" help="These will be managed by Conda" />
           <param name="interpreter_version" type="text" value=""
           label="Specific interpreter version to match dependency (Conda) repositories - e.g. for python '3.8.5' Latest if empty"/>
-            <param name="exe_package_version" type="text" value=""
-              label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty"/>
           <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="Script goes here" area="True"
               help="If there are parameters, either positional or argparse style, the script must parse and use them appropriately">
               <sanitizer>
@@ -131,10 +134,14 @@
 $__tool_directory__/rgToolFactory2.py --bad_user $__user_email__
  #else:
 $__tool_directory__/rgToolFactory2.py
+--dependencies "$interexe.dependencies"
 --runmode "$interexe.interpreter"
+   #if len(str($interexe.cl_override)) > 0:
+--cl_override "$interexe.cl_override"
+   #end if
    #if str($interexe.interpreter)=="Executable" or str($interexe.interpreter)=="system":
 --exe_package="$interexe.exe_package"
-    #if str($interexe.exe_package_version) != 'None' :
+    #if $interexe.exe_package_version:
 --exe_package_version="$interexe.exe_package_version"
     #end if
    #else:
@@ -159,12 +166,9 @@
 --additional_parameters="$apar.param_name~~~$apar.param_value~~~$apar.param_label~~~$apar.param_help~~~$apar.param_type~~~$apar.param_CL~~~$apar.param_CLprefixed"
      #end for
    #end if
-
      #for $intab in $ppass.history_inputs:
 --input_files="$intab.input_files~~~$intab.input_CL~~~$intab.input_formats~~~$intab.input_label~~~$intab.input_help"
      #end for
-
-
      #for $otab in $ppass.history_outputs:
 --output_files "$otab.history_name~~~$otab.history_format~~~$otab.history_CL"
      #end for
@@ -220,16 +224,19 @@
             <option value="bash">bash</option>
             <option value="sh">sh</option>
             <option value="system" >A system executable found on the path such as awk/sed</option>
-            <option value="specialtestcaseinterpreterpython" >for testing only - do not use me please</option>
         </param>
         <when value="Executable">
             <param name="exe_package" type="text" value="" label="Executable package name in dependency (Conda) repositories - e.g. 'bwa'" optional="false"/>
             <param name="exe_package_version" type="text" value="" label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty" />
+            <param name="cl_override" type="text" value="" label="Command line override prefix - e.g. for ephemeris prepend the specific function such as 'workflow_install'" 
+             help="Some packages like ephemerisand planemo require a sub-command - eg planemo test - before parameters are passed. Supply that here"/>
+            <param name="dependencies" type="hidden" value="" />
         </when>
         <when value="system">
-            <param name="exe_package" type="text" value="" label="System executable to run"  optional="false"/>
-            <param name="exe_package_version" type="text" value=""
-              label="Executable package version to match dependency (Conda) repositories - e.g. for bwa='0.7.17'. Latest if empty"/>
+            <param name="dependencies" type="hidden" value="" />
+            <param name="exe_package" type="text" value="" label="System executable to run - e.g. awk"/>
+            <param name="exe_package_version" type="hidden" value="" />
+            <param name="cl_override" type="hidden" value="" />
         </when>
         <when value = "python">
            <expand macro="dynpar" />
@@ -246,9 +253,6 @@
         <when value = "sh">
            <expand macro="builtin_dynpar" />
         </when>
-         <when value = "specialtestcaseinterpreterpython">
-           <expand macro="builtin_dynpar" />
-        </when>
     </conditional>
     <conditional name = "ppass">