INCATools / ontology-development-kit

Bootstrap an OBO Library ontology
http://incatools.github.io/ontology-development-kit/
BSD 3-Clause "New" or "Revised" License
214 stars 54 forks source link

Error: `pip` not found (in GitHub Action) (edit: user error) #888

Closed joeflack4 closed 1 year ago

joeflack4 commented 1 year ago

Overview

I'm trying to use ODK in kind of an edge case way. Ideally don't want to use it as a framework for creating / maintaining an ontology and having my directory / file structure reflect the ODK standard. I'd like to use it as a simple type of development environment that has all of the software dependencies I need.

More precisely, I have an existing repository . I want to run make all the way I currently do. However, when I run this in a GitHub action it does not have robot, so it errors out. I want to ideally keep my same directory structure, but run it in an ODK container (example action) so that when it calls robot it uses what ODK has.

Where I'm currently stuck

I did a test run, but it was not able to install Python Requirements:

Run python -m pip install --upgrade pip
python: /lib/x[8](https://github.com/monarch-initiative/omim/actions/runs/5315784050/jobs/9624570004#step:5:9)6_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by python)
gouttegd commented 1 year ago

Ideally don't want to use it as a framework for creating / maintaining an ontology and having my directory / file structure reflect the ODK standard. I'd like to use it as a simple type of development environment that has all of the software dependencies I need.

This is not, in my opinion, an “edge case way“ at all. :) The ODK is both a “toolbox” and a standard workflow (which itself relies on a standard repository layout), and using the toolbox only without adopting the standard workflow is a perfectly legitimate use case.

That being said, I am not sure I understand what you are in effect trying to do in your “test run”. Why are you trying to install Python?

If you want the tools from the ODK to be available in your GitHub Action, all you have to do is to configure said action to use the ODK image (container: obolibrary/odkfull). Then all the ODK tools (including ROBOT) will be reachable in the PATH for any command you execute in the action, so your Makefile will be able to find and execute ROBOT normally.

joeflack4 commented 1 year ago

@gouttegd Thanks for the timely response!

On the note of this not being an edge case, I think the docs could use an update --in terms of using ODK in this way and also in general. Something like an ordered list of steps to set up.

I'm not actually trying to install Python, but it looks like I have been upgrading pip, which is not a bad practice but not really needed here. I didn't realize that's what was tripping it up; I thought it was just installing Python dependencies using pip. But I'm surprised it's erroring on that line anyway.

I've set the action up to use ODK in that simple way, but now I'm getting this error (which I kinda expected might happen because of the failed pip upgrade):

pip install -r requirements.txt
make: pip: No such file or directory
gouttegd commented 1 year ago

I'm not actually trying to install Python

Well, yes you are:

   - name: Set up Python 3.10
      uses: actions/setup-python@v2
      with:
        python-version: '3.10'

You invoke an action to install Python 3.10. Not only this is not needed as the ODK already comes with Python 3.10, I strongly suspect this is the cause of the subsequent failure. This action updates the PATH so that the version of Python it installs becomes the default Python that is invoked by a call to python (or pip) – in effect, “hiding” the version of Python that is bundled with the ODK.

joeflack4 commented 1 year ago

Ah my bad, you're right. I was focused too much on the specific error message.

I simply repurposed an existing action by adding container: obolibrary/odkfull, but it makes sense that there are other things that I should change. Will give this a shot today!

joeflack4 commented 1 year ago

I'm good now! Thanks for the help!