Sunday, September 29, 2013

Try CoreOS and Docker at Futuregrid

Docker and CoreOS are interesting new software. You can try them on FutureGrid.

Before you try this, you need to have your FutureGrid account, of course, and should know how to use OpenStack at FutureGrid. Here's the link --> http://manual.futuregrid.org/openstackgrizzly.html

First, login to sierra and setup your OpenStack environment.
ssh username@sierra.futuregrid.org
module load novaclient
source .futuregrid/novarc

Boot an instance with CoreOS image.
nova boot coreos1 --flavor m1.small --image futuregrid/coreos --key_name keyname

Check the status of the instance with "nova list", and if it's "ACTIVE", login to the instance
ssh -i /path/to/your/pub-key core@10.35.23.119
Warning: Permanently added '10.35.23.119' (RSA) to the list of known hosts.
   ______                ____  _____
  / ____/___  ________  / __ \/ ___/
 / /   / __ \/ ___/ _ \/ / / /\__ \
/ /___/ /_/ / /  /  __/ /_/ /___/ /
\____/\____/_/   \___/\____//____/
core@coreos1 ~ $

Execute "echo Hello World!" inside a container.
docker run base /bin/echo Hello World!
Unable to find image 'base' (tag: latest) locally
Pulling repository base
b750fe79269d: Download complete
27cf78414709: Download complete
Hello World!

What it does is, 1. download the "base" image, 2. execute "echo Hello World!". The downloading process only happens at the first time. So if you execute "docker run base /bin/echo Hello World!" again, you can see what I meant.

Next, you can login to a container with this.
docker run -i -t base /bin/bash

If you check the OS with "lsb_release -a", you can find the base image is Ubuntu 12.10.
root@d7a0470c0e16:/# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
root@d7a0470c0e16:/# exit
exit
core@coreos1 ~ $ 

Next, execute a command in the background.
docker run -i -t -d base /bin/ping www.google.com
81e7918c9724

You can see the status of the container with this.
docker ps
ID                  IMAGE               COMMAND                CREATED             STATUS              PORTS
81e7918c9724        base:latest         /bin/ping www.google   41 seconds ago      Up 40 seconds

Take a look at the container.
docker logs 81e7918c9724
PING www.google.com (74.125.224.211) 56(84) bytes of data.
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=1 ttl=53 time=9.96 ms
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=2 ttl=53 time=9.97 ms
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=3 ttl=53 time=10.0 ms
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=4 ttl=53 time=9.95 ms
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=5 ttl=53 time=10.0 ms
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=6 ttl=53 time=9.96 ms
64 bytes from lax02s02-in-f19.1e100.net (74.125.224.211): icmp_req=7 ttl=53 time=9.95 ms

You can attach to the container with this.
docker attach 81e7918c9724
* When you want to detach, press "Ctrl-p" and "Ctrl-q".

Terminate the command.
docker kill 81e7918c9724
docker ps

So, now you think your container is gone, but actually what you did is stored. You can see the list with this.
docker ps -a -notrunc
ID                                                                 IMAGE               COMMAND                    CREATED             STATUS              PORTS
1c94ff1e5c6a180c525e7dc709e59d3f5275d38bcfbc057862eeb3ce8821e1e8   base:latest         /bin/ping www.google.com   13 minutes ago      Exit 0
64cf0b3a9f6b30bf794f312ec72596a7bb3b465dc2d93c1513228ecee8da3238   base:latest         /bin/bash                  24 minutes ago      Exit 0
a5000a2ba33503775eab2e0740b906971e29abad87d934d48efff6c6ab061fcd   base:latest         /bin/echo Hello World!     37 minutes ago      Exit 0

You can delete one with "docker rm <ID>" like this.
docker rm 1c94ff1e5c6a180c525e7dc709e59d3f5275d38bcfbc057862eeb3ce8821e1e8
docker ps -a -notrunc

Also, if you commit one of them, it will be saved as an image.
docker commit -m "My first container" 1c94ff1e5c6a180c525e7dc709e59d3f5275d38bcfbc057862eeb3ce8821e1e8 username/first_container

So, now you have your first custom image on the list. Means that you can install software packages, add something more as needed, commit the change, and execute a command or run a daemon very quickly. It's all done inside the container!
docker images
REPOSITORY                TAG                 ID                  CREATED             SIZE
username/first_container   latest              40cd6f5b996e        12 seconds ago      16.39 kB (virtual 180.1 MB)
base                      latest              b750fe79269d        6 months ago        24.65 kB (virtual 180.1 MB)
base                      ubuntu-12.10        b750fe79269d        6 months ago        24.65 kB (virtual 180.1 MB)
base                      ubuntu-quantal      b750fe79269d        6 months ago        24.65 kB (virtual 180.1 MB)
base                      ubuntu-quantl       b750fe79269d        6 months ago        24.65 kB (virtual 180.1 MB)


...So, with using Docker, you can build and train your system as a container and save it like a file very quickly. (Docker only overwrites the differences from the base image and save it in "/var/lib/docker/containers/", which is why it's so quick.) Also, the great thing about Docker is you can share your image on https://index.docker.io/.

One more interesting thing to say here is, the CoreOS is based on Google’s ChromeOS that automatically updates. So CoreOS is like a ChromeOS on the Cloud, but it's, of course, more than that. To my knowledge, the idea of CoreOS is to build your massive cluster on the Cloud as easily and quickly as possible.

I'll do more research about them. So please keep checking this blog. Thanks!

For more information:

Tuesday, September 24, 2013

Please participate in the FutureGrid user survey

We welcome your feedback all year round, but this week we're conducting an anonymous user survey designed to help us recognize our strengths, identify areas that call for improvement, and focus our time, energy, and resources to most effectively meet the needs of the FutureGrid community.  

We have sent emails to all FutureGrid users.  Please check your inbox and perhaps your spam folder, if necessary.  The survey is brief and should only take a few minutes of your time.  We would appreciate hearing from you in the next day or two.  If you have already responded, we thank you for your thoughtful insights.

We will be sending out a reminder email to users who have not yet responded.  Hopefully you'll receive it and be able to participate.  It means a lot to us when community members take time to share about their experiences with FutureGrid.

We will be reading the survey feedback carefully and factoring it in as we plan for Year 5.  Anything requiring immediate attention from FutureGrid systems and support teams should be addressed through the help ticket system:  https://portal.futuregrid.org/help

Thursday, September 19, 2013

CentOS 6, SL 6 and Debian 7 are available on OpenStack

We are happy to announce that we have added some more useful cloud images on our OpenStack. Now we have CentOS 6, Scientific Linux 6 and Debian 7. And interesting CoreOS too.

[ktanaka@s1 images]$ nova image-list|grep futuregrid
| 53fab752-757e-4b2a-bce6-9f74ba76be26 | futuregrid/centos-6                   | ACTIVE |                                      |
| d5b19d33-8440-4069-815a-de9d8629dae3 | futuregrid/coreos                     | ACTIVE |                                      |
| d40facd1-7496-42b7-8bc7-70235396d349 | futuregrid/debian-7                   | ACTIVE |                                      |
| 18c437e5-d65e-418f-a739-9604cef8ab33 | futuregrid/fedora-18                  | ACTIVE |                                      |
| 1c46e959-5805-47da-a079-58900787ef25 | futuregrid/fedora-19                  | ACTIVE |                                      |
| 8f289ebb-d8fb-48f6-8429-430110eacb4a | futuregrid/sl-6 <- Scientific Linux   | ACTIVE |                                      |
| 1a5fd55e-79b9-4dd5-ae9b-ea10ef3156e9 | futuregrid/ubuntu-12.04               | ACTIVE |                                      |
| f7459a50-3ef4-40f5-a7d7-955fb3af6432 | futuregrid/ubuntu-13.10               | ACTIVE |                                      |

You can boot your instance with this:
nova boot --image <image name> --flavor m1.small --key-name <your key> <instance name>

For more information about how-to, please visit our OpenStack Grizzly Manual.

Also, if you're interested in CoreOS, please check the link.
http://coreos.com/docs/using-coreos/

Thanks,

Friday, September 13, 2013

OpenStack Tips: Download a cloud-image on India's OpenStack and upload to Sierra's OpenStack

Here's how to download an image from India's OpenStack and upload it to Sierra's OpenStack.

1. On Sierra, make sure you've done step1 and step2 of our grizzly tutorial.

2. On your local machine, download your credential from india.
scp -rp [username]@india.futuregrid.org:~/.futuregrid .futuregrid.india
3. On your local machine, upload the credential to sierra. (*Do not overwrite your.futuregrid on sierra.)
scp -rp .futuregrid.india [username]@sierra.futuregrid.org:~/.futuregrid.india
4. On Sierra, load india's credential.
source ~/.futuregrid.india/openstack/novarc
module load novaclient
5. On Sierra, check your image id and download your image/ramdisk/kernel.
nova image-list|grep [name]
glance image-download [id] --file [file name to save]
6. On Sierra, load sierra's novarc.
source ~/.futuregrid/novarc
7. On Sierra, upload them.
glance image-create --name= --disk-format=aki --container-format=aki < kernel-file
glance image-create --name= --disk-format=ari --container-format=ari < ramdisk-name
glance image-create --name= --disk-format=ami --container-format=ami --property kernel_id=[kernel_id] --property ramdisk_id=[ramdisk_id] < your-image-file.img