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

tilt up not working for local development #342

Closed
CorsettiS opened this issue Jun 26, 2023 · 6 comments
Closed

tilt up not working for local development #342

CorsettiS opened this issue Jun 26, 2023 · 6 comments

Comments

@CorsettiS
Copy link
Contributor

CorsettiS commented Jun 26, 2023

When I tried to follow the guidelines of local development using tilt, I got the following error

Loading Tiltfile at: ***/astronomer-cosmos/Tiltfile
Traceback (most recent call last):
  ***/astronomer-cosmos/Tiltfile:1:15: in <toplevel>
Error in docker_compose: command ["docker" "compose" "--project-name" "dev" "--project-directory" "***/astronomer-cosmos/dev" "-f" "***/astronomer-cosmos/dev/docker-compose.yaml" "config"] failed.
error: exit status 14
stdout: ""
stderr: 'open ***/astronomer-cosmos/dev/.env: no such file or directory
@jlaneve
Copy link
Collaborator

jlaneve commented Jun 26, 2023

Can you try creating an empty .env file and see if that fixes the issue?

@CorsettiS
Copy link
Contributor Author

CorsettiS commented Jun 26, 2023

@jlaneve it fixes it partially, however there are still few errors coming up


ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
       → google-cloud-workflows 1.7.1 requires protobuf<4.0.0dev,>=3.19.0, but you have protobuf 4.23.3 which is incompatible.
       → google-cloud-vision 1.0.2 requires protobuf<4.0.0dev, but you have protobuf 4.23.3 which is incompatible.
       → google-cloud-videointelligence 1.16.3 requires protobuf<4.0.0dev, but you have protobuf 4.23.3 which is incompatible.
       → google-cloud-translate 1.7.2 requires protobuf<4.0.0dev, but you have protobuf 4.23.3 which is incompatible.
       → google-cloud-texttospeech 1.0.3 requires protobuf<4.0.0dev, but you have protobuf 4.23.3 which is incompatible.
       → google-cloud-tasks 2.10.1 requires protobuf<4.0.0dev,>=3.19.0, but you have protobuf 4.23.3 which is incompatible.
...
STEP 2/2 — Deploying
Container dev-airflow-init-1  Creating
Container dev-airflow-init-1  Created
no such service: redis

got unexpected error during build/deploy: command ["docker" "compose" "--project-name" "dev" "--project-directory" "***/astronomer-cosmos/dev" "-f" "***/astronomer-cosmos/dev/docker-compose.yaml" "up" "--no-deps" "-d" "airflow-init"] failed.
error: exit status 1

Build Failed: command ["docker" "compose" "--project-name" "dev" "--project-directory" "***/astronomer-cosmos/dev" "-f" "***/astronomer-cosmos/dev/docker-compose.yaml" "up" "--no-deps" "-d" "airflow-init"] failed.
error: exit status 1

For the aforementioned one, it is strange though since the redis is available

@jlaneve
Copy link
Collaborator

jlaneve commented Jun 28, 2023

@CorsettiS I actually just removed the dependency on redis (and flower) - the changes are now on main. Can you try again and see if it works now?

Also, does the pip error stop Airflow from running? Or does it still proceed, just with the (potentially) wrong dependencies?

@CorsettiS
Copy link
Contributor Author

@jlaneve unfortunately there is still an error taking place, now on postgres side

Screenshot 2023-06-29 at 10 20 12
STEP 3/3 — Deploying
Container dev-airflow-init-1  Creating
Container dev-airflow-init-1  Created
no such service: postgres

got unexpected error during build/deploy: command ["docker" "compose" "--project-name" "dev" "--project-directory" "/***/astronomer-cosmos/dev" "-f" "/***/astronomer-cosmos/dev/docker-compose.yaml" "up" "--no-deps" "-d" "airflow-init"] failed.
error: exit status 1

The postgres container is up & running tho. when I access it, I obtain the following logs

PostgreSQL Database directory appears to contain a database; Skipping initialization


2023-06-29 08:19:43.922 UTC [1] LOG:  starting PostgreSQL 13.11 (Debian 13.11-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

2023-06-29 08:19:43.922 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432

2023-06-29 08:19:43.922 UTC [1] LOG:  listening on IPv6 address "::", port 5432

2023-06-29 08:19:43.925 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2023-06-29 08:19:43.932 UTC [27] LOG:  database system was interrupted; last known up at 2023-06-29 08:16:01 UTC

2023-06-29 08:19:44.114 UTC [27] LOG:  database system was not properly shut down; automatic recovery in progress

2023-06-29 08:19:44.116 UTC [27] LOG:  redo starts at 0/15CFF48

2023-06-29 08:19:44.116 UTC [27] LOG:  invalid record length at 0/15CFF80: wanted 24, got 0

2023-06-29 08:19:44.116 UTC [27] LOG:  redo done at 0/15CFF48

2023-06-29 08:19:44.131 UTC [1] LOG:  database system is ready to accept connections

I then tried to run a simple psql command inside the container, but got the following error

# psql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL:  role "root" does not exist

I am not a docker expert so it is hard for me to properly give a better feedback, sorry for that.

@tatiana
Copy link
Collaborator

tatiana commented Jun 29, 2023

@CorsettiS Are you able to use psql to connect to Postgres with the credentials defined in the Docker compose file?
https://github.com/astronomer/astronomer-cosmos/blob/main/dev/docker-compose.yaml#L36-L39

Also, which operating system are you using?

@CorsettiS
Copy link
Contributor Author

CorsettiS commented Jun 30, 2023

@tatiana I am, it connects fine. I am currently using a Mac. Instead of using tilt, I just manually did a docker compose up and it worked fine. I do not know how this tilt command works, but from what I saw it is breaking the build process of the docker compose file. I would advocate for changing the contribute guide and tell people to set up the environment with a docker compose directly. It is more straightforward from my point of view.

@CorsettiS CorsettiS reopened this Jun 30, 2023
jlaneve pushed a commit that referenced this issue Jul 4, 2023
## Description

From my personal experience using tilt, it did not work locally, while
the classic docker compose command worked fine. I would suggest to
change it to docker compose to simplify development, although it is
understandable if the project wants to stick with tilt since it should,
in theory simplify some of the overhead.

## Related Issue(s)

this is a fix for a issue I was facing #342 

## Breaking Change?

No

## Checklist

- [X] I have made corresponding changes to the documentation (if
required)
- [ ] I have added tests that prove my fix is effective or that my
feature works

---------

Co-authored-by: giovanni.corsetti <[email protected]>
harels pushed a commit that referenced this issue Jul 27, 2023
## Description

In the process of setting up the dev environment, an empty .env file is
requested to build the image. Since there is no visible impact on having
it not having it, for consistency it is better to remove this not used
dependency from the docker compose yml file.

## Related Issue(s)

somehow related to #342 

## Breaking Change?

No major changes are going to happen

## Checklist

- [ ] I have made corresponding changes to the documentation (if
required)
- [ ] I have added tests that prove my fix is effective or that my
feature works

---------

Co-authored-by: giovanni.corsetti <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Harel Shein <[email protected]>
tatiana pushed a commit that referenced this issue Aug 9, 2023
## Description

In the process of setting up the dev environment, an empty .env file is
requested to build the image. Since there is no visible impact on having
it not having it, for consistency it is better to remove this not used
dependency from the docker compose yml file.

## Related Issue(s)

somehow related to #342 

## Breaking Change?

No major changes are going to happen

## Checklist

- [ ] I have made corresponding changes to the documentation (if
required)
- [ ] I have added tests that prove my fix is effective or that my
feature works

---------

Co-authored-by: giovanni.corsetti <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Harel Shein <[email protected]>
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

3 participants