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

fix: remove obsoleted 'version' elements in compose files #5553

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

kurokobo
Copy link
Contributor

@kurokobo kurokobo commented Jun 24, 2024

Description

This PR removes the line version: '3' from all docker-compose*.yaml files.

The version element is already obsoleted, and causes warning to be shown in the newer compose plugin:

The top-level version property is defined by the Compose Specification for backward compatibility. It is only informative and you'll receive a warning message that it is obsolete if used.
https://docs.docker.com/compose/compose-file/04-version-and-name/

Example warnings are here; the same warning will be shown on any other docker compose commands:

$ docker compose up -d
WARN[0000] /home/********/dify/docker/docker-compose.yaml: `version` is obsolete      👈👈👈👈👈
[+] Running 12/12
 ✔ Network docker_ssrf_proxy_network  Created                                                                                                                                                                   0.1s 
 ✔ Network docker_default             Created                                                                                                                                                                   0.1s 
 ✔ Container docker-sandbox-1         Started                                                                                                                                                                   0.5s 
 ✔ Container docker-weaviate-1        Started                                                                                                                                                                   0.8s 
 ✔ Container docker-web-1             Started                                                                                                                                                                   0.6s 
 ✔ Container docker-db-1              Started                                                                                                                                                                   0.7s 
 ✔ Container docker-ssrf_proxy-1      Started                                                                                                                                                                   0.9s 
 ✔ Container docker-redis-1           Started                                                                                                                                                                   0.6s 
 ✔ Container docker-bot-1             Started                                                                                                                                                                   0.7s 
 ✔ Container docker-worker-1          Started                                                                                                                                                                   1.5s 
 ✔ Container docker-api-1             Started                                                                                                                                                                   1.4s 
 ✔ Container docker-nginx-1           Started        

$ docker compose logs api --tail=5
WARN[0000] /home/********/dify/docker/docker-compose.yaml: `version` is obsolete       👈👈👈👈👈
api-1  | None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
api-1  | [2024-06-24 12:57:14 +0000] [22] [INFO] Starting gunicorn 22.0.0
api-1  | [2024-06-24 12:57:14 +0000] [22] [INFO] Listening at: http://0.0.0.0:5001 (22)
api-1  | [2024-06-24 12:57:14 +0000] [22] [INFO] Using worker: gevent
api-1  | [2024-06-24 12:57:14 +0000] [37] [INFO] Booting worker with pid: 37

$ docker compose exec api flask db history
WARN[0000] /home/********/dify/docker/docker-compose.yaml: `version` is obsolete        👈👈👈👈👈
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
4e99a8df00ff -> 7b45942e39bb (head), add-api-key-auth-binding
64a70a7aab8b -> 4e99a8df00ff, add load balancing
03f98355ba0e -> 64a70a7aab8b, add workflow run index
9e98fbaffb88 -> 03f98355ba0e, add workflow tool label and tool bindings idx
.....

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tried invoking docker compose commands such as down, up, logs, ps, pull, start, stop and confirmed that there is no warning

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working labels Jun 24, 2024
@crazywoola crazywoola requested review from takatost and laipz8200 June 24, 2024 13:16
@takatost
Copy link
Collaborator

Hey, I couldn't find in the docker doc which specific version of the docker compose client started supporting the loose version parameter. If we remove it abruptly, it might affect existing users. Do you have more information on this?

@kurokobo
Copy link
Contributor Author

kurokobo commented Jun 25, 2024

@takatost
Hi, thanks for your review!

which specific version of the docker compose client started supporting the loose version parameter.

TL;DR

  • Compose stopped referencing version about 4 years ago, Sep. 2020, back when everyone was still using the docker-compose command instead of docker compose command.
  • By the time the compose subcommand was added to the docker command, version was already obsolete. This was in 2022.
  • The old Compose V1 engine that used version already reached EOL in Jun. 2023.

Details:
Docker Compose stopped using version with the release of Docker Compose 1.27.0 on 2020-09-07. Up until version 1.26.x, Docker Compose used versioned schemas like 2.x and 3.x, but these were unified into a single non-versioned schema known as the Compose Specification. Docker Compose started using this specification from version 1.27.0 onwards, where version became merely informative.

Legacy versions 2.x and 3.x of the Compose file format were merged into the Compose Specification. It is implemented in versions 1.27.0 and above (also known as Compose V2) of the Docker Compose CLI.
https://docs.docker.com/compose/compose-file/

The top-level version property is defined by the Compose Specification for backward compatibility. It is only informative
https://docs.docker.com/compose/compose-file/04-version-and-name/

Just before the release of 1.27.0, a PR makes version to optional, and around the same time, another PR removed all versioned schemas and unified them into one schema without a version number.

The addition of the compose subcommand to the docker command happened two years later in April 2022 with the release of Compose V2, which also (and of course) uses the Compose Specification and thus does not recognize version.

As of today, version only matters if the users are using an old Compose V1 (pre-1.27) with the traditional docker-compose command. And it has been announced that Compose V1 was reached EOL in June 2023 (see Proposed Compose V1 End-of-Life Timeline on this page).

Summary:
From my understanding, version is meaningless in most current environments for most users, and can be safely removed.
If there is any user impact due to this change, it means those users have been running an outdated Docker Compose for at least 4 years without upgrading.
I believe there is little value in maintaining support for such EOL-ed environments at the expense of new environment users receiving WARNs.

Copy link
Collaborator

@takatost takatost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your kind explanation!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 26, 2024
@takatost takatost merged commit 8d9a459 into langgenius:main Jun 26, 2024
5 checks passed
@kurokobo kurokobo deleted the compose branch June 26, 2024 12:24
Scorpion1221 added a commit to yybht155/dify that referenced this pull request Jun 26, 2024
* commit '8d9a45908397b3f3c0d56e86160bb97b5611b79b': (240 commits)
  fix: remove obsoleted 'version' elements in compose files (langgenius#5553)
  chore: add a secondary confirmation dialog when the user delete the tool (langgenius#5634)
  fix: ro-RO is not a valid language (langgenius#5635)
  FR: langgenius#4048 - Add color customization to the chatbot  (langgenius#4885)
  feat: tracing fe (langgenius#5487)
  feat: add ops trace (langgenius#5483)
  chore: cleanup test_delete_by_document_id method in opensearch vdb test (langgenius#5619)
  chore(pyproject.toml): Add Ruff formatter config. (langgenius#5627)
  Fix link to documentation of nodes (langgenius#5623)
  feat: undo/redo for workflow editor (langgenius#3927)
  fix: populate app configs to system environment variables (langgenius#5590)
  fix: DuckDuckGo image search tool error (langgenius#5606)
  delete the deprecated method  (langgenius#5612)
  fix: context icon in chat (langgenius#5604)
  fix: Modify the incorrect configuration name for Google storage (langgenius#5595)
  feat: update issue template (langgenius#5592)
  chore: fix typo in config descriptions (langgenius#5585)
  fix: add support for FILE type in ToolParameterConverter (langgenius#5578)
  Fix/single run panel show parent scrollbar (langgenius#5574)
  refactor: extract cors configs into dify config and cleanup the config class (langgenius#5507)
  ...

# Conflicts:
#	.github/workflows/build-push.yml
#	api/Dockerfile
#	api/core/helper/code_executor/code_executor.py
#	api/requirements.txt
Scorpion1221 added a commit to yybht155/dify that referenced this pull request Jun 26, 2024
* commit '17d2f0bb0d3c7618ed59968613175d2344fcbdc1': (145 commits)
  fix(api/configs): Ignore empty environment variables when loading config. (langgenius#5647)
  fix: type error in config (langgenius#5643)
  fix: remove obsoleted 'version' elements in compose files (langgenius#5553)
  chore: add a secondary confirmation dialog when the user delete the tool (langgenius#5634)
  fix: ro-RO is not a valid language (langgenius#5635)
  FR: langgenius#4048 - Add color customization to the chatbot  (langgenius#4885)
  feat: tracing fe (langgenius#5487)
  feat: add ops trace (langgenius#5483)
  chore: cleanup test_delete_by_document_id method in opensearch vdb test (langgenius#5619)
  chore(pyproject.toml): Add Ruff formatter config. (langgenius#5627)
  Fix link to documentation of nodes (langgenius#5623)
  feat: undo/redo for workflow editor (langgenius#3927)
  fix: populate app configs to system environment variables (langgenius#5590)
  fix: DuckDuckGo image search tool error (langgenius#5606)
  delete the deprecated method  (langgenius#5612)
  fix: context icon in chat (langgenius#5604)
  fix: Modify the incorrect configuration name for Google storage (langgenius#5595)
  feat: update issue template (langgenius#5592)
  chore: fix typo in config descriptions (langgenius#5585)
  fix: add support for FILE type in ToolParameterConverter (langgenius#5578)
  ...

# Conflicts:
#	.github/workflows/build-push.yml
#	api/Dockerfile
#	api/requirements.txt
ZhouhaoJiang added a commit that referenced this pull request Jun 28, 2024
* refs/heads/main: (45 commits)
  fix: do not remove (#5682)
  Feature/add qwen llm (#5659)
  Fix docker command (#5681)
  feature: Add presence_penalty and frequency_penalty parameters to the … (#5637)
  Feat/fix ops trace (#5672)
  feat: xxo enhancement. (#5671)
  chore: rearrange python dependencies in groups (#5603)
  chore: delete unused resource (#5667)
  fix: knowledge retrieval score threshold setting (#5658)
  feat: add jina new pre-defined rerankers, include: jina-reranker-v2 (#5657)
  fix: tool call message role according to credentials (#5625)
  fix: HTTP request header is overwritten when user set Content-Type (#5628)
  chore: apply flake8-comprehensions Ruff rules to improve collection comprehensions (#5652)
  fix(api): language list (#5649)
  fix(api/configs): Ignore empty environment variables when loading config. (#5647)
  fix: type error in config (#5643)
  fix: remove obsoleted 'version' elements in compose files (#5553)
  chore: add a secondary confirmation dialog when the user delete the tool (#5634)
  fix: ro-RO is not a valid language (#5635)
  FR: #4048 - Add color customization to the chatbot  (#4885)
  ...

# Conflicts:
#	api/config.py
#	web/app/components/datasets/settings/form/index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants