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

Adding requirements-local.txt support #9357

Merged
merged 2 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ apache-superset-*.tar.gz*

# Translation binaries
messages.mo

docker/requirements-local.txt
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
######################################################################
FROM lean AS dev

COPY ./requirements-dev.txt ./docker/requirements-extra.txt /app/
COPY ./requirements-dev.txt ./docker/requirements* /app/

USER root
RUN cd /app \
&& pip install --no-cache -r requirements-dev.txt -r requirements-extra.txt
&& pip install --no-cache -r requirements-dev.txt -r requirements-extra.txt \
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason to not just direct users to add extra requirements in requirements-extra.txt?

Copy link
Member Author

@craig-rueda craig-rueda Mar 23, 2020

Choose a reason for hiding this comment

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

Yep, we don't want users' local changes being managed in Git

&& pip install --no-cache -r requirements-local.txt || true
USER superset
12 changes: 12 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ intended for use with local development.
In order to override configuration settings locally, simply make a copy of [./docker/pythonpath/superset_config_local.example](./docker/pythonpath/superset_config_local.example)
into [./docker/pythonpath/superset_config_docker.py](./docker/pythonpath/superset_config_docker.py) (git ignored) and fill in your overrides.

### Local packages

If you want to add python packages in order to test things like DBs locally, you can simply add a local requirements.txt (./docker/requirements-local.txt)
and rebuild your docker stack.

Steps:
1. Create ./docker/requirements-local.txt
2. Add your new packages
3. Rebuild docker-compose
a. `docker-compose down -v`
b. `docker-compose up`

## Initializing Database

The DB will initialize itself upon startup via the init container (superset-init)
Expand Down