nmfs-ost / ss3-source-code

The source code for Stock Synthesis (SS3).
https://nmfs-ost.github.io/ss3-website/
Creative Commons Zero v1.0 Universal
37 stars 16 forks source link

use github actions to compile SS #104

Closed k-doering-NOAA closed 3 years ago

k-doering-NOAA commented 3 years ago

The goal here would be to build windows, linux, and mac versions of ss automatically. Jenkins can only build the linux version for now.

Started to put this together (24c3b78)

The steps I see toward doing this are:

k-doering-NOAA commented 3 years ago

I am stuck on this. I've been working on a workflow in: https://github.com/nmfs-stock-synthesis/stock-synthesis/blob/setup-gh-actions/.github/workflows/build.yml

The issue is I can't figure out how to add ADMB to the PATH; the admb command is therefore not recognized. I've tried many different ways, including the recommended way and methods I've used on Jenkins, but I haven't gotten anything to work so that ADMB is found.

I will try reaching out to people who have used github actions before to see if they have any idea what I'm doing wrong.

kellijohnson-NOAA commented 3 years ago

Try @ChristineStawitz-NOAA

k-doering-NOAA commented 3 years ago

Sara Ogaz figured it out in 10 min! EDIT: the issues was I had to add admb-12.2/bin to the path instead of admb-12.2 or admb-12.2/bin/admb

k-doering-NOAA commented 3 years ago

Making good progress on this. Some notes:

k-doering-NOAA commented 3 years ago

Successfully was able to setup workflows to compile all mac and windows SS binaries! Remaining issues to clean up:

k-doering-NOAA commented 3 years ago

After talking a bit with @iantaylor-NOAA about file permissions and reading a little more online, I'm not sure if the permissions for linux and mac binaries were created correctly even before github actions. I'm not sure if there was any way to guarantee this aside from distributing the executables some other way (for example, in the .tar format, which supposedly ships files with their permissions?) I think the simplest solution for now would be not to worry about permissions and instead document this potential problem so that users know they can run chmod a+x to make SS executable. I would expect linux users know this, but mac users may not (as someone who used mac for many years and never thought about file permissions).

If anyone has other thoughts about how to deal with this issue, please let me know!

kellijohnson-NOAA commented 3 years ago

I pinged a few people that are Mac users and they said that this has been an issue for them, especially when teaching a class where they are trying to distribute the executable. Their workaround was to use "chmod 755 ss" to get it to work and manually copy the executable (or at least the path to the executable) to each directory they used.

k-doering-NOAA commented 3 years ago

Thanks for confirming my suspicion, @kellijohnson-NOAA! Given this, I think just adding to the SS website/documentation that you may have to change permissions on your machine using chmod may be the best path forward for now.

I'm going to close this issue, but we can reopen it or create a new issue if we get another lead about a way to fix distribution permissions problems.

kellijohnson-NOAA commented 3 years ago

Lee Qi confirmed that chmod +x ss didn't work for some people, but chmod 755 did.

k-doering-NOAA commented 3 years ago

Thanks, I just assumed chmod a+x alone would work, but maybe the write and read privileges are important, too. The a+x is easier for me to remember, which is why I use it, but I will stick to the numbers from now on to be more specific! Theses are the specific permissions 755 gives, in case it is helpful: https://chmodcommand.com/chmod-755/