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

Airflow set up, part 3: Fixing issue with docker compose syntax #223

Closed

Conversation

tskir
Copy link
Contributor

@tskir tskir commented Nov 2, 2023

Closes opentargets/issues#3143.

Third and final part of updates for opentargets/issues#3143, split for readability and easier review.

For me, on Ubuntu, docker-compose (with hyphen) works, while docker compose (with space) does not:

docker: 'compose' is not a docker command.
See 'docker --help'

I installed it in a standard way via apt (sudo apt install docker.io).

It looks like this distinction has a long history: docker/compose#8630; and certainly there are fixes and workarounds about this.

However, I was wondering: @d0choa @ireneisdoomed, does docker-compose (with hyphen) work for you on your machines?

  • If yes, we can leave this option as seemingly the most compatible.
  • If no, then I'll amend this PR and specify this discrepancy and potential workarounds.

@tskir tskir requested review from d0choa and ireneisdoomed November 2, 2023 19:07
@tskir tskir linked an issue Nov 2, 2023 that may be closed by this pull request
@d0choa
Copy link
Collaborator

d0choa commented Nov 3, 2023

I have no issue using docker-compose:

❯ ls /usr/local/bin/ | grep docker
com.docker.cli
docker
docker-compose
docker-compose-v1
docker-credential-desktop
docker-credential-ecr-login
docker-credential-gcloud
docker-credential-osxkeychain
docker-diagnose
docker-image-tool.sh
docker-index
kubectl.docker

Update: But the fact that the official Airflow documentation is written using the docker compose syntax makes me wonder:
https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html#initialize-the-database

Update: it seems docker-compose is deprecated. You might need to look at your setup @tskir
https://stackoverflow.com/questions/66514436/difference-between-docker-compose-and-docker-compose

@tskir tskir force-pushed the tskir-3143-2-fix-for-uid branch 3 times, most recently from b3c5eaa to ebc383e Compare November 5, 2023 07:58
@tskir tskir force-pushed the tskir-3143-3-fix-for-docker-compose branch from 423d533 to 528136e Compare November 5, 2023 09:15
@tskir
Copy link
Contributor Author

tskir commented Nov 5, 2023

Thank you very much for the pointers @d0choa! I investigated further, and apparently the issue was that my Docker installation on Ubuntu was done years ago, before it even had official Ubuntu packages. So all this time I was using an unofficial package docker.io, which, while it kept updating the actual Docker versions, didn't port the compose command to new syntax.

I've reverted syntax back to "docker compose" and added a note in case anyone encounters this in the future.

@codecov-commenter
Copy link

Codecov Report

Merging #223 (528136e) into tskir-3143-2-fix-for-uid (ebc383e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           tskir-3143-2-fix-for-uid     #223   +/-   ##
=========================================================
  Coverage                     85.64%   85.64%           
=========================================================
  Files                            81       81           
  Lines                          1853     1853           
=========================================================
  Hits                           1587     1587           
  Misses                          266      266           

@d0choa
Copy link
Collaborator

d0choa commented Nov 6, 2023

We can live without this warning. We can probably assume someone is using a moderately modern version of Docker.

@d0choa d0choa closed this Nov 6, 2023
@tskir
Copy link
Contributor Author

tskir commented Nov 6, 2023

@d0choa Here's the thing though: I did have the latest version of Docker installed and still ran into this error. It's not about the version, it's about the packages which were used to install it.

Docker only started officially providing Linux packages two years ago. So everyone who installed it on Debian/Ubuntu more than two years ago using the docker.io package (which was the recommended way to install at the time), and then kept updating to the latest version as I did, will still run into this problem.

My opinion remains that having this warning, which might apply to a sizable portion of Debian/Ubuntu users, would be helpful. Especially seeing as we do keep a platform specific warning about macOS memory issues 🙃

@tskir tskir deleted the tskir-3143-3-fix-for-docker-compose branch November 6, 2023 11:27
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.

Update Airflow documentation following testing
3 participants