Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cog notebook feature broken #1624

Open
li-dennis opened this issue Apr 18, 2024 · 0 comments
Open

Cog notebook feature broken #1624

li-dennis opened this issue Apr 18, 2024 · 0 comments

Comments

@li-dennis
Copy link

Hi all, great project!

Playing around this, hoping to get a notebook server running via cog. Looking at the docs, I should just be able to run cog run jupyter notebook but I immediately run into trouble. It seems like jupyter isn't in the PATH of the docker container?

cog.yaml


build:
  gpu: true
  python_version: "3.9"
  system_packages:
    - "git"
  python_packages:
    - "torch==2.0.0"
    - "jupyterlab==3.3.4"
    - "transformers"

predict: "predict.py:Predictor"

Output:

Running 'jupyter lab --allow-root --ip=0.0.0.0' in Docker with the current directory mounted as a volume...
[FATAL tini (7)] exec jupyter failed: No such file or directory
Running 'jupyter notebook --allow-root --ip=0.0.0.0' in Docker with the current directory mounted as a volume...
[FATAL tini (7)] exec jupyter failed: No such file or directory

Looking at the generated Dockerfile via cog debug > Dockerfile, I'd guess it's because pyenv isn't setup correctly?

...
ENV PATH="/root/.pyenv/shims:/root/.pyenv/bin:$PATH"
...
RUN curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash && \
	git clone https://github.com/momo-lab/pyenv-install-latest.git "$(pyenv root)"/plugins/pyenv-install-latest && \
	pyenv install-latest "3.9" && \
	pyenv global $(pyenv install-latest --print "3.9") && \
	pip install "wheel<1"
RUN --mount=type=cache,target=/var/cache/apt apt-get update -qq && apt-get install -qqy git && rm -rf /var/lib/apt/lists/*
RUN --mount=type=bind,from=deps,source=/dep,target=/dep cp -rf /dep/* $(pyenv prefix)/lib/python*/site-packages || true
WORKDIR /src
EXPOSE 5000
CMD ["python", "-m", "cog.server.http"]
COPY . /src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant