I am following the below instructions to install superset. In this step "superset runserver -d" getting an error below. How do I fix this issue. Thanks
[DEPRECATED] As of Flask >=1.0.0, this command is no longer supported, please use flask run instead, as documented in our CONTRIBUTING.md
[example]
flask run -p 8080 --with-threads --reload --debugger
# Install superset
pip install superset
# Create an admin user (you will be prompted to set a username, first and last name before setting a password)
fabmanager create-admin --app superset
# Initialize the database
superset db upgrade
# Load some data to play with
superset load_examples
# Create default roles and permissions
superset init
# To start a development web server on port 8088, use -p to bind to another port
superset runserver -d
Yesterday commit https://github.com/apache/incubator-superset/pull/5966 fixed similiar issue with docker install. Try to clone repo from scratch and go trough the following steps:
git clone https://github.com/apache/incubator-superset/
cd incubator-superset/contrib/docker
# prefix with SUPERSET_LOAD_EXAMPLES=yes to load examples:
docker-compose run --rm superset ./docker-init.sh
# you can run this command everytime you need to start superset now:
docker-compose up
New installation doc: https://github.com/apache/incubator-superset/blob/master/docs/installation.rst
Try the below steps:
$ pip install flask==1.0.0
$ pip install sqlalchemy==1.2.18
$ pip uninstall pandas
$ pip install pandas==0.23.4
Related
So I'm trying to run Django developing server on a container but I can't access it through my browser. I have 2 containers using the same docker network, one with postgress and the other is Django. I manage to ping both containers and successfully connect 2 of them together and run ./manage.py runserver ok but can't curl or open it in a browser
Here is my Django docker file
FROM alpine:latest
COPY ./requirements.txt .
ADD ./parking/ /parking
RUN apk add --no-cache --virtual .build-deps python3-dev gcc py3-pip postgresql-dev py3-virtualenv musl-dev libc-dev linux-headers
RUN virtualenv /.env
RUN /.env/bin/pip install -r /requirements.txt
WORKDIR /parking
EXPOSE 8000 5432
The postgres container I pulled it from docker hub
I ran django with
docker run --name=django --network=app -p 127.4.3.1:6969:8000 -it dev/django:1.0
I ran postgres with
docker run --name=some-postgres --network=app -p 127.2.2.2:6969:5432 -e POSTGRES_PASSWORD=123 -e POSTGRES_DB=parking postgres
Any help would be great. Thank you
I think you forget to add the command to run your application at the and of the dockerfile, when you run this image it just start the virtualenv and install all python dependencies at the requirements.txt, but the django application was not started. You need put at the end something like
CMD "python parking/manage.py runserver"
this will make your container still running at the choosed port and make you application accessible at 127.4.3.1:6969:8000.
Okay so I manage to figure it out, I have looked at #leonardo-alves-dos-santos answer and I come to the conclusion that I run CMD "python parking/manage.py runserver 0.0.0.0:8000" . Now I can access my Django app with Django container port 127.4.3.1:6969 and 172.18.0.2:8000 from docker network
I need to install ERPNEXT on AWS, I wish if someone can share the recommendation for a good HA setup, also I am stuck in how to put redis on Elasticache?
Install ERPNEXT:
Download the install script
For Linux:
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
Run the install script
If you are on a fresh server and logged in as root, use --user flag to create a user and install using that user
python install.py --develop --user frappe
For developer setup:
sudo python install.py --develop
For production:
sudo python install.py --production --user frappe
Reference URL: https://github.com/frappe/bench
I want to install one of the jupyter containers with python 2.X using docker-stacks.
The documentation at GitHub for jupyter/docker-stacks say:
Python 2.x was removed from all images on August 10th, 2017, starting in tag cc9feab481f7. If you wish to continue using Python 2.x, pin to tag 82b978b3ceeb.
See:
https://github.com/jupyter/docker-stacks
I assume you run this as follows to, say for example, install minimal-notebook:
docker run -it --rm -p 8888:8888 jupyter/minimal-notebook:82b978b3ceeb
But after running I find that python 3.x was installed:
sys.version_info(major=3, minor=6, micro=2, releaselevel='final', serial=0)
Here's the output of the 'docker run' command:
$ docker run -it --rm -p 8888:8888 jupyter/minimal-notebook:82b978b3ceeb
/usr/local/bin/start.sh: line 48: [: missing `]'
/usr/local/bin/start.sh: line 48: : command not found
Execute the command
[I 20:55:49.950 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[W 20:55:49.979 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 20:55:50.010 NotebookApp] JupyterLab alpha preview extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
JupyterLab v0.24.1
Known labextensions:
[I 20:55:50.013 NotebookApp] Running the core application with no additional extensions or settings
[I 20:55:50.016 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 20:55:50.016 NotebookApp] 0 active kernels
[I 20:55:50.017 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=f09a12bf53902cb20aca2f1924011e1e80d51243cc10a390
[I 20:55:50.017 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 20:55:50.017 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=f09a12bf53902cb20aca2f1924011e1e80d51243cc10a390
There's a recipe for creating a Python 2 conda environment in FROM one of the core images on the GitHub wiki: https://github.com/jupyter/docker-stacks/wiki/Docker-recipes#add-a-python-2x-environment
I notice that the link suggested in previous post is not there anymore, so I put here the some with some modifications.
You could create the following Dockerfile:
# From https://github.com/jupyter/docker-stacks/wiki/Docker-recipes#add-a-python-2x-environment
# Choose your desired base image: you could use another from https://github.com/busbud/jupyter-docker-stacks
FROM jupyter/all-spark-notebook:latest
# Create a Python 2.x environment using conda including at least the ipython kernel
# and the kernda utility. Add any additional packages you want available for use
# in a Python 2 notebook to the first line here (e.g., pandas, matplotlib, etc.)
RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 ipython ipykernel kernda && \
conda clean -tipsy
USER root
# Bundle requirements
# You can change the libraries in the file
# requirements.txt
ADD requirements.txt /requirements.txt
# Create a global kernelspec in the image and modify it so that it properly activates
# the python2 conda environment.
RUN $CONDA_DIR/envs/python2/bin/python -m ipykernel install && \
$CONDA_DIR/envs/python2/bin/kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json && \
pip install -r /requirements.txt && \
rm /requirements.txt && \
USER $NB_USER
or if you do not have requirements
# From https://github.com/jupyter/docker-stacks/wiki/Docker-recipes#add-a-python-2x-environment
# Choose your desired base image: you could use another from https://github.com/busbud/jupyter-docker-stacks
FROM jupyter/all-spark-notebook:latest
# Create a Python 2.x environment using conda including at least the ipython kernel
# and the kernda utility. Add any additional packages you want available for use
# in a Python 2 notebook to the first line here (e.g., pandas, matplotlib, etc.)
RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 ipython ipykernel kernda && \
conda clean -tipsy
USER root
# Create a global kernelspec in the image and modify it so that it properly activates
# the python2 conda environment.
RUN $CONDA_DIR/envs/python2/bin/python -m ipykernel install && \
$CONDA_DIR/envs/python2/bin/kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json &
USER $NB_USER
Then go to the folder:
To create image:
docker build -t wm/ubuntupython2jupyterpyspark:v1.0 .
wm/ubuntupython2jupyterpyspark:v1.0 is just an example you could put another
To run container
docker run -p 8888:8888 wm/ubuntupython2jupyterpyspark:v1.0
I deployed Superset on Ubuntu 14.04 from the source code and it works fine. Now I want to play with the superset code to make required changes. Like adding the Png downloadable option for charts.I made changes but it didn't reflect Superset build. How to make changes in Superset code that should reflect Superset on browser?
code Build Process:
git clone https://github.com/airbnb/superset
cd ${SUPERSET_HOME}/superset/assets
npm install : Will install the npm dependencies
pip install virtualenv : Will install virtualenv
virtualenv venv : Set virtualenv
. ./venv/bin/activate : activate virtualenv
pip install --upgrade setuptools pip : Will upgrade
npm run prod : Set NODE_ENV variable and run dependencies
cd ${SUPERSET_HOME}
python setup.py install
//Create an admin user :
fabmanager create-admin --app superset
//Initialize the database :
superset db upgrade
//Load some data to play with :
superset load_examples
//Create default roles and permissions :
superset init
//To start the server : superset runserver -p 9002
You can read all the details here: https://github.com/airbnb/superset/blob/master/CONTRIBUTING.md#setting-up-a-python-development-environment
The main idea is to install for development using:
python setup.py develop
And run dev server:
superset runserver -d
I have a django app that I will need to deploy on Amazon's EC2 Container Service. In the meantime, in order to test the deployment, I am trying to deploy it in a docker container locally first, but even when running a simple demo django application, I am unable to see the page at localhost:8000.
Here is my setup.
Create a docker machine:
$ docker-machine create --driver virtualbox testmachine
After this I set up my environment:
$ eval "$(docker-machine env testmachine)"
I set up a Dockerfile for my test container:
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install python-pip -y
RUN pip install django
RUN mkdir django_test
RUN cd django_test && \
django-admin.py startproject django_test .
Then I call
$ docker build -t dockertest .
... builds successfully
$ docker run -d -i -t -p 8000:8000 dockertest
cbef144ac068eb61b0c3e032448cc207c8f0384a9a67a710df6d9beb26d2ab32
$ docker attach cbef144ac068eb61b0c3e032448cc207c8f0384a9a67a710df6d9beb26d2ab32
root#cbef144ac068:/# cd django_test
root#cbef144ac068::/django_test# python manage.py runserver 0.0.0.0:8000
This successfully starts the server at 0.0.0.0:8000/ of the container.
However, when I try to go to localhost:8000 in my browser, I get a "This webpage is not available." What am I missing?
Turns out I was looking at the wrong IP.
To figure out the correct IP, I ran:
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
testmachine * virtualbox Running tcp://192.168.99.100:2376
I then loaded 192.168.99.100:8000 in my browser, and it worked like a charm.