setup-cog icon indicating copy to clipboard operation
setup-cog copied to clipboard

Install system packages before pip packages

Open christian-safka opened this issue 2 years ago • 2 comments

      - name: Setup Cog
          uses: replicate/[email protected]
          with:
             cog-version: v0.9.0-beta6

      - name: 'Build Container Image'
         run: |
          cog build -t model-name:latest --tag ghcr.io/namespace/model-name:latest

One pip package requires cmake to be installed but it seems that system packages don't finish installing before the pip install. This builds fine locally. This should be replicable by adding cmake in system packages and "dlib" in pip packages.

Any way to make those system/pip installs run synchronously after each other?

christian-safka avatar Sep 25 '23 14:09 christian-safka

Hi thanks for the report. Can you share a bit more detail about the workflow you're running and the errors you're seeing?

This builds fine locally.

What is your local setup?

This should be replicable by adding cmake in system packages and "dlib" in pip packages

You mean in cog.yaml?

Not sure it matters, but are you using python_packages or python_requirements?

zeke avatar Sep 26 '23 22:09 zeke

Locally in a Linux VM I installed cog in my virtual environment and can build using the same 'cog build' command that fails in the Github Actions runner.

Yes, I meant in cog.yaml and I'm using python_packages

christian-safka avatar Sep 27 '23 13:09 christian-safka

Hey sorry this issue got pretty stale. If you're still experiencing this, you might want to try using the run key in cog.yaml, which lets you specify commands to run in the environment after your system packages and Python packages have been installed. Not sure if that's the order you expected, but might unblock you.

Gonna close this issue because you've likely moved on to other things, but please comment here if you're still having trouble.

zeke avatar Jun 17 '24 18:06 zeke