-
Notifications
You must be signed in to change notification settings - Fork 8
chore: update readme and better error logging #2117
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Fixed commands (check for user) | ||
| # give hint on actual docker name container E.g. bold_buck random name | ||
| docker exec -i bold_buck psql -U citycatalyst -d postgres -v ON_ERROR_STOP=1 -c "CREATE USER climateadvisor WITH PASSWORD 'climateadvisor';" | ||
|
|
||
| docker exec -i bold_buck psql -U citycatalyst -d postgres -v ON_ERROR_STOP=1 -c "CREATE DATABASE climateadvisor OWNER climateadvisor;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use created container name in docker exec examples
The setup instructions start the PostgreSQL container with --name ca-postgres, but the subsequent docker exec commands target bold_buck. Unless the user happens to have a container with that randomly generated name, these commands fail with “No such container: bold_buck”, preventing database initialization. The examples should reference ca-postgres (or explain how to discover the actual container name) so the instructions can be executed as written.
Useful? React with 👍 / 👎.
| docker exec -i ca-postgres psql -U postgres -d postgres | ||
| CREATE USER climateadvisor WITH PASSWORD 'climateadvisor'; | ||
| CREATE DATABASE climateadvisor OWNER climateadvisor; | ||
| GRANT ALL PRIVILEGES ON DATABASE climateadvisor TO climateadvisor; | ||
| ALTER USER climateadvisor CREATEDB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQL commands no longer piped into psql
Previously the README used a here-document to feed the SQL statements into psql. The updated snippet runs docker exec -i ca-postgres psql -U postgres -d postgres and then lists the SQL lines as separate shell commands. Executing the instructions now causes the shell to try running CREATE USER … and the other SQL as binaries, resulting in command not found and leaving the database user and schema uncreated. The SQL needs to be passed via -c arguments or wrapped again in a here-document so it executes inside psql.
Useful? React with 👍 / 👎.
|
Needed to also change in the .envs: CC_BASE_URL=http://localhost:3000 (from internal.docker....) |
lemilonkh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks 👍
| uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload | ||
| ``` | ||
|
|
||
| TODO: instead of uvicorn chanfe config to use docker container here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be fixed in this PR?
No description provided.