Installing COPASI on Heroku

Skip to first unread message

Sebino Hoo

Mar 30, 2022, 11:23:00 PMMar 30
to COPASI User Forum
I'm in the process of developing a spring boot web application that uses COPASI's Java bindings to run SBML models. Running it requires a COPASI installation if I'm correct, and that can't be done on Heroku as only packages available on packages.ubuntu can be installed.
Is there another way around this, can I say, copy the files from a Linux COPASI installation into the git repository or maybe even just some files.

Frank Bergmann

Mar 31, 2022, 3:32:19 AMMar 31
to COPASI User Forum
I have not tried Heroku yet, but will create a free account to give it a try. 

My thoughts at this point are. that you just need the Linux Java bindings in your heroku project, and ensure that when starting the spring instance, the .so file is in the -Djava.library.path and the copasi.jar file in the classpath. From there, you will have to be careful though with the COPASI objects, to ensure they are only ever accessed from the same thread, and don't go out of scope. 

I'll let you know more once i've tested it. 


Frank Bergmann

Mar 31, 2022, 9:33:31 AMMar 31
to COPASI User Forum
Ok, just to report back. I found it extremely easy to use the COPASI python bindings in a Heroku Python project (which uses django), that together with basico made it really easy to directly simulate models. 

With Java it was a bit more involved. the key steps are: 

* add the / jar to your git project (in my example a ./copasi directory in the root)
* change the proc file to add the path to the directory, so it should start: 

web: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./copasi java -jar target/...

* now for the tricky bit to sneak the copasi.jar file into the maven project: 
   * create a local repository directory (for me 'repo')
   * convert the local copasi.jar into a maven artifact using the maven-install-plugin
   * add all files from the repo directory to your git project. 

* modify the pom.xml to include the local 'repo' as repository
* and add the local copasi artifact as dependency. 

From then on i was able to run all copasi methods (just as in the java examples) in the spring boot controllers. 

I hope this helps, dont hesitate to ask for more information. 

Reply all
Reply to author
0 new messages