Mercurial > repos > metexplore > met4j
comparison HowTo.md @ 6:7a6f2380fc1d draft
planemo upload for repository https://forgemia.inra.fr/metexplore/met4j-galaxy
author | metexplore |
---|---|
date | Wed, 17 May 2023 13:26:37 +0000 |
parents | ae4c301919c4 |
children | 1436e9cde9c9 |
comparison
equal
deleted
inserted
replaced
5:35c9abcd8934 | 6:7a6f2380fc1d |
---|---|
1 # How to build wrappers for new met4j-toolbox apps? | 1 # How to build wrappers for new met4j-toolbox apps? |
2 | 2 |
3 ## Install planemo | 3 ## Install planemo |
4 | 4 |
5 ```console | 5 ```console |
6 virtualenv --python=/usr/bin/python3.8 .venv; | 6 pip install virtualenv |
7 source .venv/bin/activate | 7 python -m virtualenv planemo |
8 . planemo/bin/activate | |
9 pip install --upgrade pip setuptools | |
8 pip install planemo | 10 pip install planemo |
9 ``` | 11 ``` |
10 | 12 |
11 ## Install singularity | 13 ## Install singularity |
12 | 14 |
13 Doc [Here](https://github.com/sylabs/singularity/blob/main/INSTALL.md). | 15 Doc [Here](https://github.com/sylabs/singularity/blob/main/INSTALL.md). |
14 | 16 |
15 ## Create new wrappers | 17 ## Create new wrappers |
16 | 18 |
17 1. Create a branch (e.g. newFeature) (or a new release) in met4j and develop your apps | 19 - Create a branch (e.g. newFeature) (or a new release) in met4j and develop your apps |
18 2. Push the branch | 20 - Push the branch |
19 3. If this branch is not master or develop, launch manually the | 21 - If this branch is not master or develop, launch manually the |
20 building of the singularity image in the met4j CI-CD (this singularity image will be downloaded by the galaxy instance) | 22 building of the singularity image in the met4j CI-CD (this singularity image will be downloaded by the galaxy instance) |
21 4. Create a branch with the same name in met4j-galaxy (e.g. newFeature) | 23 - Create a branch with the same name in met4j-galaxy (e.g. newFeature) |
22 5. Use the GenerateGalaxyFiles of the met4j-toolbox (be careful, it must be the version of the new branch) to generate the wrappers for the new met4j apps. Or you can use the singularity image created in the third step. | 24 - Use the GenerateGalaxyFiles of the met4j-toolbox (be careful, it must be the version of the new branch) to generate the wrappers for the new met4j apps. Or you can use the singularity image created in the third step. |
23 | 25 |
24 ```console | 26 ```console |
25 met4j-toolbox.sif GenerateGalaxyFiles \ | 27 met4j-toolbox.sif GenerateGalaxyFiles \ |
26 -o /path/to/met4j-galaxy/tools \ | 28 -o /path/to/met4j-galaxy/tools |
27 -v newFeature | |
28 | |
29 ``` | 29 ``` |
30 | 30 |
31 Where newFeature is the name of the new branch. | 31 ## Write tests |
32 | 32 |
33 6. Edit manually the wrappers where the tests are lacking. | 33 - Edit manually the wrappers where the tests are lacking. |
34 | 34 |
35 [Here](https://docs.galaxyproject.org/en/latest/dev/schema.html#tool-tests) is the documentation about tests in galaxy | 35 [Here](https://docs.galaxyproject.org/en/latest/dev/schema.html#tool-tests) is the documentation about tests in galaxy |
36 | 36 |
37 Put the test files in a test-data directory in the tool directory. | 37 Put the test files in a test-data directory in the tool directory. |
38 If the file is used in several tests, put it in the data directory at the root of the project and create a symbolic link in the test-data directory. | 38 If the file is used in several tests, put it in the data directory at the root of the project and create a symbolic link in the test-data directory. |
39 | 39 |
40 7. Check the syntax of the wrappers | 40 ## Check the syntax of the wrappers |
41 | 41 |
42 ```console | 42 ```console |
43 source .venv/bin/activate | 43 . planemo/bin/activate |
44 planemo shed_lint --tools \ | 44 planemo shed_lint --tools \ |
45 --ensure_metadata \ | 45 --ensure_metadata \ |
46 --urls \ | |
47 --report_level warn \ | 46 --report_level warn \ |
48 --fail_level error \ | 47 --fail_level error \ |
49 --recursive tools | 48 --recursive tools |
50 ``` | 49 ``` |
51 | 50 |
52 8. Launch the tests | 51 ## Find apps without tests |
52 | |
53 ```console | |
54 python ./findToolsWithoutTests.py build/tools/ | |
55 ``` | |
56 | |
57 ## Launch the tests | |
58 | |
59 ### Build with a version number | |
60 | |
61 To test your apps, you need to fill the good version of met4j singularity in each xml wrapper. For this, use this command: | |
62 | |
63 ```bash | |
64 ./build.sh $versionNumber | |
65 ``` | |
66 | |
67 Where $versionNumber must correspond to the version of the met4j singularity instance created above. | |
68 | |
69 ### Launch the tests on the built instance | |
53 | 70 |
54 Launching all the tests can be very time consuming. | 71 Launching all the tests can be very time consuming. |
55 | 72 |
56 You can launch the test for one tool (here convert.Sbml2Graph): | 73 You can launch the test for one tool (here convert.Sbml2Graph): |
57 | 74 |
58 ```console | 75 ```console |
59 source .venv/bin/activate | 76 . planemo/bin/activate |
60 planemo test \ | 77 planemo test \ |
61 --galaxy_source https://github.com/galaxyproject/galaxy \ | |
62 --galaxy_branch release_22.01 \ | |
63 --job_config_file config/job_conf.xml \ | 78 --job_config_file config/job_conf.xml \ |
64 tools/convert/Sbml2Graph/ | 79 build/tools/Sbml2Graph/ |
65 ``` | |
66 | |
67 or for an entire package (here convert): | |
68 | |
69 ```console | |
70 source .venv/bin/activate | |
71 planemo test \ | |
72 --galaxy_source https://github.com/galaxyproject/galaxy \ | |
73 --galaxy_branch release_22.01 \ | |
74 --job_config_file config/job_conf.xml \ | |
75 tools/convert/Sbml2Graph/ | |
76 ``` | 80 ``` |
77 | 81 |
78 If you want to test all the tools: | 82 If you want to test all the tools: |
79 | 83 |
80 ```console | 84 ```console |
81 source .venv/bin/activate | 85 . planemo/bin/activate |
82 planemo test \ | 86 planemo test \ |
83 --galaxy_source https://github.com/galaxyproject/galaxy \ | 87 --job_config_file config/job_conf.xml \ |
84 --galaxy_branch release_22.01 \ | 88 build/tools/* |
85 --job_config_file config/job_conf.xml | |
86 ``` | 89 ``` |
87 | 90 |
88 The results of the tests can be read in tool_test_output.html. | 91 The results of the tests can be read in tool_test_output.html. |
89 | 92 |
90 9. If all the tests are ok, merge the new met4j branch in develop | 93 ## Create new release |
91 10. Create a new met4j release and finish the release: it will create a new singularity image for this version | |
92 11. Launch once again GenerateGalaxyFiles | |
93 | 94 |
94 ```console | 95 When tests are ok, you can create a new met4j release. The CI will create a new Singularity image corresponding to this version. |
95 met4j-toolbox.sif GenerateGalaxyFiles \ | 96 |
96 -o /path/to/met4j-galaxy/tools \ | 97 Create a new met4j-galaxy release with the same version number as met4j. After push, the CI will test again the apps. If it's ok, a new version of met4j-galaxy will be pushed on the galaxy toolshed. The instance in usegalaxy.fr will be updated the next monday. |
97 -v 1.1.1 | 98 |
99 ## Update met4j-galaxy-runner | |
100 | |
101 Docker image to run planemo on ci. | |
102 | |
103 Creation du docker pour lancer galaxy et planemo : | |
104 | |
105 ```bash | |
106 sudo docker login | |
107 sudo docker build -t metexplore/met4j-galaxy-runner:latest . | |
108 sudo docker push metexplore/met4j-galaxy-runner:latest | |
98 ``` | 109 ``` |
99 | 110 |
100 where 1.1.1 is the number of the new release | 111 <https://hub.docker.com/r/metexplore/met4j-galaxy-runner> |
101 | |
102 12. In met4j-galaxy, launch planemo lint to check if there is app without test and if everything is ok | |
103 13. Test all the tools | |
104 14. Merge on develop, create a new release, and push | |
105 | |
106 This will test again all the tools on the gitlab CI/CD. If it's ok, a new version of met4j-galaxy will be pushed on the galaxy toolshed. The instance in usegalaxy.fr will be updated the next monday. |