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

chore(docker): dockerfiles improvements and fixes #1792

Merged
merged 24 commits into from
Jul 30, 2024

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Mar 25, 2024

  • UID and GID build arguments for worker user. This is useful to not have to change permissions on bind mounted directories.
  • POETRY_EXTRAS build argument with default values. Useful to re-build the image with some extras using --build-arg POETRY_EXTRAS="..."
  • Copy Makefile in Docker image so commands such as make ingest can be used
  • Do NOT copy markdown files. I doubt anyone reads a markdown file within a Docker image
  • Fix PYTHONPATH value where path should be /home/worker/app/private_gpt instead of /private_gpt
  • Set home directory to /home/worker when creating user. This resolves a bunch of side dependencies warnings/problems.
  • Combine ENV instructions together. Just a tiny bit faster to rebuild.
  • Define environment variables with their defaults
    • For documentation purposes
    • Reflect defaults set in settings-docker.yml
  • PGPT_EMBEDDING_MODE to define embedding mode. It's not always the same mode as the llm.
  • Remove ineffective python3 -m pipx ensurepath (does not work and is fulfilled by ENV PATH="/root/.local/bin:$PATH")
  • Use && instead of ; to chain commands to detect failure better

Next PRs (after this one gets merged):

  1. merge both Dockerfile together. Highly possible especially given the new build argument POETRY_EXTRAS.
  2. Add missing openai variables and definitions in settings-docker.yaml
  3. Add docker documentation
  4. Pick up Fix docker compose up and MacBook segfault #1428

@szastavnyy
Copy link

Hello All. Please clarify what command is better to use to build docker image locally, upload to GCP and use ? I do not see useful info in documentation related to docker creation

@qdm12
Copy link
Contributor Author

qdm12 commented Apr 4, 2024

@szastavnyy see #1789 (comment)

@qdm12 qdm12 force-pushed the qdm12/dockerfile-1 branch from 9b5dc53 to 5fc6b7c Compare May 6, 2024 10:27
@qdm12
Copy link
Contributor Author

qdm12 commented May 6, 2024

@zylon-ai I keep on updating this branch, it would be nice to have a review at some point. Thanks 😉

@qdm12 qdm12 force-pushed the qdm12/dockerfile-1 branch from 5fc6b7c to c6c4b2c Compare May 6, 2024 14:34
@qdm12 qdm12 force-pushed the qdm12/dockerfile-1 branch from c6c4b2c to 479fdc1 Compare May 6, 2024 14:41
Dockerfile.external Outdated Show resolved Hide resolved
Dockerfile.external Outdated Show resolved Hide resolved
settings-docker.yaml Outdated Show resolved Hide resolved
jaluma added 7 commits July 24, 2024 09:14
* fix: ffmpy dependency

* fix: block ffmpy to commit sha
* chore: update ollama (llm)

* feat: allow to autopull ollama models

* fix: mypy

* chore: install always ollama client

* refactor: check connection and pull ollama method to utils

* docs: update ollama config with autopulling info

...
Copy link
Contributor

@jaluma
Copy link
Collaborator

jaluma commented Jul 29, 2024

Updated this PR since it's really useful :)
Goal: Implement a better out-of-the-box Docker experience.


I've included:

  1. Fix Tiktoken cache PermissionError: [Errno 13] Permission denied: 'tiktoken_cache' while creating docker container #1876 (comment)
  2. Change Docker-compose port to 8001
  3. Autopulling images when docker image is running
  4. All requested change by myself

Copy link
Contributor

@jaluma jaluma merged commit 65c5a17 into zylon-ai:main Jul 30, 2024
8 checks passed
@qdm12
Copy link
Contributor Author

qdm12 commented Aug 2, 2024

Thanks, sorry for the delay getting back at this PR! I'll rebase other branches I have based off this one soon, for more Docker-related improvements/ease-of-use.

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

Successfully merging this pull request may close these issues.

4 participants