Cannot add a Linux image to my MicroStack / add an instance to OpenStack - openstack

How do I install a Linux image (https://cloud-images.ubuntu.com) in MicroStack (https://ubuntu.com/tutorials/microstack-get-started#2-install-microstack)? This question is close: How to install packages in cirros OS. But doesn't share the command that is needed. For example, I've tried the following:
microstack launch cirros --name test
The above works, but can't use it as it has no packages. So unusable.
So I tried the following, nothing is working
microstack launch ubuntu --name test
microstack launch debian --name test
microstack launch focal --name test
Second, I've download the a ubuntu ISO. And attempted to upload the image under Compute > Images. While it uploads in the GUI of OpenStack aka Horizon. The following error happens: "Flavor's disk is too small for requested image."

Related

How to create a docker image of an existing R Shiny app in windows?

The dockerization process of an R shiny app is done through rocker/shiny image. I require to run the dockerization on an R shiny app from a windows system. The only problem is that rocker/shiny used for this process is a Linux based container. Therefore, I am unable to generate an image that runs on my windows system. Utilization of an external VPS or VM is not an option for me due to security reasons.
I have tried writing a docker file that would run for windows, but the problem is that the container is Linux based.
My Dockerfile
FROM rocker/r-ver:3.5.1
#installing R libraries
RUN R -e "install.packages(c('shiny', 'shinydashboard'), repos='http://cran.us.r-project.org')"
# Copy configuration files into the Docker image
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
COPY /app/srv/shiny-server/
# Make the ShinyApp available at port 80
EXPOSE 80
#Copy further configuration files into the Docker image
COPY shiny-server.sh /usr/bin/shiny-server.sh
CMD ['Rscript', 'app_run.R']
(original documentation mentions a .sh file which is not running on my system
because of the Linux windows file path issues)
After running there 2 commands I expect my shiny app to run on localhost:8080
Get-Content Dockerfile | docker build -
docker run --name DOCKERapp -p 8080:8080 <image_name>
The base in your dockerfile is rocker/r-ver:3.5.1 and the based of this image is debian. You can check here:
https://hub.docker.com/r/rocker/r-ver/dockerfile
So in your dockerfile you need to use linux commands. You don't need to use windows commands.

Open RStudio Project from the attached volume when starting Rocker container

I am trying to build my works using Docker System. It would be nice to start Rstudio server when I start a container attaching a project from a mounted volume. For example, I can start the docker as,
docker run -d -p 8787:8787 -v $(pwd):/home/rstudio --name rocker rocker/verse:latest
It runs Rstudio server and I can access it from 8787 port but it would be nice to load the project from /home/rstudio when I start the container.
There's a hidden file you can modify:
~/.rstudio/projects_settings/switch-to-project
Populate it with the path of the project you want RStudio to open at startup.

Airflow installation issue on Windows 7

How to install Airflow on Windows 7? getting below error while installing it using pip install apache-airflow :
---------------------------------------- Command "c:\users\shrgupta5\appdata\local\programs\python\python36-32\python.exe
-u -c "import setuptools, tokenize;__file__='C:\\Users\\SHRGUP~1\\AppData\\Loca l\\Temp\\pip-build-_yptw7sa\\psutil\\setup.py';f=getattr(tokenize, 'open', open) (__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __fi le__, 'exec'))" install
--record C:\Users\SHRGUP~1\AppData\Local\Temp\pip-_cwm0n u7-record\install-record.txt --single-version-externally-managed
--compile" fail ed with error code 1 in C:\Users\SHRGUP~1\AppData\Local\Temp\pip-build-_yptw7sa\ psutil\
I wouldn't bother trying to install Airflow on windows, even after you install it successfully you cannot run the airflow script due to a dependency on the unix-only module pwd
You can run Airflow on Windows by using the Docker setup from puckel https://github.com/puckel/docker-airflow.
Use VirtualBox and Docker Toolbox(legacy) and setup a docker-machine on your Windows computer (docker-machine create -d virtualbox --virtualbox-cpu-count "2" --virtualbox-memory "2048" default)
make sure to fork puckels git repo underneath c:/Users/yourusername/documents otherwise mounting of DAGS won't work
You should now be able to spin up Airflow e.g. by using the celery-executor setup with docker compose -f docker-compose-CeleryExecutor.yml up -d
I have setup a environment where I develop the DAGs on Windows, test them within the dockercontainer and then push the Dockerimage to Linux to production. I have added a more detailed tutorial here.
Airflow cannot be installed on Windows within the standard command prompt.
You need to use bash and afterwards change the config:
How to run Airflow on Windows
Download the source of airflow from pypi:
https://pypi.org/project/airflow/#files
Unzip and edit setup.cfg, then go to the install_requires section and change the version of psutil with the following: 'psutil>=5.4.7',
Finally, run python setup.py install in the source directory

Instance creation in devstack icehouse

I want to create few instance having ubuntu installed on it using openstack.
I tried following steps
Approach 1
installed icehouse devstack
git clone -b stable/icehouse https://github.com/openstack-dev/devstack.git
cd devstack
./stack.sh
after successful installation i uploaded a ubuntu image
glance image-create --name Ubuntu --disk-format iso --container-format bare <~/sumit/images/ubuntu-14.04.2-desktop-amd64.iso
login to dashboard and launch the instance (m1.small, RAM GB, total disk 20GB) using this image.
open the instance console from horizon dashboard and try to install ubuntu
Βut it shows required space(6.5GB) in not available.
Τhen I tried to install neutron and heat also
Approach 2
installed icehouse devstack
git clone -b stable/icehouse https://github.com/openstack-dev/devstack.git
cd devstack
vi localrc
my localrc looks like
DEST=/opt/stack
LOGFILE=$DEST/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=False
SCREEN_LOGDIR=$DEST/logs/screen
ADMIN_PASSWORD=password
MYSQL_PASSWORD=openstack
RABBIT_PASSWORD=openstack
SERVICE_PASSWORD=openstack
SERVICE_TOKEN=tokentoken
GLANCE_BRANCH=stable/icehouse
HORIZON_BRANCH=stable/icehouse
KEYSTONE_BRANCH=stable/icehouse
NOVA_BRANCH=stable/icehouse
NEUTRON_BRANCH=stable/icehouse
HEAT_BRANCH=stable/icehouse
CEILOMETER_BRANCH=stable/icehouse
DISABLED_SERVICES=n-net ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-metering,neutron
ENABLED_SERVICES+=,q-lbaas
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
HEAT_STANDALONE=True
ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
ENABLED_SERVICES+=,ceilometer-alarm-notify,ceilometer-alarm-eval
After this
./stack.sh
after successful installation Ι uploaded a ubuntu image
glance image-create --name Ubuntu --disk-format iso --container-format bare <~/sumit/images/ubuntu-14.04.2-desktop-amd64.iso
login to dashboard and launch the instance (m1.small, RAM GB, total disk 20GB) using this image.
But now it displays
Error: Unable to connect to Neutron
Every time Ι list the instance it displays same error.
Can anyone help me out to overcome all these problems so that Ι can launch some instances and install ubuntu on that.
Unable to connect can be because neutron service is not running. Through Dashboard you cannot create instance without network. Use screen command in devstack to check if neutron is running properly.

How to deploy Meteor and Phusion Docker to Digital Ocean with Docker?

What is a workflow for deploying to Digital Ocean with Phusion Docker and Node/Meteor support?
I tried :
FROM phusion/passenger-nodejs:0.9.10
# Set correct environment variables.
ENV HOME /root
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]
# ssh
ADD private/keys/akey.pub /tmp/your_key
RUN cat /tmp/your_key >> /root/.ssh/authorized_keys && rm -f /tmp/your_key
## Download shit
RUN apt-get update
RUN apt-get install -qq -y python-software-properties software-properties-common curl git build-essential
RUN npm install fibers#1.0.1
# install meteor
RUN curl https://install.meteor.com | /bin/sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Enable nginx
# RUN rm -f /etc/service/nginx/down
#setup app
RUN mkdir /home/app/someapp
ADD . /home/app/someapp
WORKDIR /home/app/someapp
EXPOSE 4000
CMD passenger start -p 4000
But nothing is working and then I'm not sure how to really manage update/deploy/running?
E.g, how would you also handle updating the app without rebuilding the docker image?
Here is my suggested workflow:
Create an account on Docker Hub, you can get 1 private repository for free. If you want a complete private repository hosted on your own server, you can run an entire docker registry and use it to host your images.
Create your image on your development machine (locally or on a server), then push the image to the repository using docker push
Update the image when needed and commit your changes with docker commit then push the updated image to your repository (you should properly version and tag all your images)
You can start a digital ocean droplet with docker pre-installed (from applications tab) and simply pull your image and run your container. Whenever you update and push your image from your development machine, simple pull it again from the droplet.
For large and complex infrastructure, I would recommend looking into Ansible to configure your docker containers and manage digital ocean droplet as well.
Be aware that your data will be lost if you stop the container, so consider defining a volume in your container that is mapped to a shared folder on your host machine
I suggest you test your Dockerfile in a local VirtualBox VM. I wrote a tutorial about deploying node.js app with Docker. I build several images (layers) instead of just 1. When you update your app, you just need to rebuild the top layer. Hope it helps. http://vinceyuan.blogspot.com/2015/05/deploying-web-app-redis-postgres-and.html

Resources