ceph/cn

Name: cn

Owner: Ceph

Description: Ceph Nano - One step S3 in container with Ceph.

Created: 2017-11-27 01:19:15.0

Updated: 2018-05-23 11:54:20.0

Pushed: 2018-05-23 11:56:46.0

Homepage:

Size: 147

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cn (ceph-nano)

Ceph, the future of storage

The project

cn is a little program written in Go that helps you interact with the S3 API by providing a REST S3 compatible gateway. The target audience is developers building their applications on Amazon S3. It is also an exciting tool to showcase Ceph Rados Gateway S3 compatibility. This is brought to you by the power of Ceph and Containers. Under the hood, cn runs a Ceph container and exposes a Rados Gateway. For convenience, cn also comes with a set of commands to work with the S3 gateway. Before you ask “why not using s3cmd instead?“, then you will be happy to read that internally cn uses s3cmd and act as a wrapper around the most commonly used commands. Also, keep in mind that the CLI is just for convenience, and the primary use case is you developing your application directly on the S3 API.

Installation

cn relies on Docker so it must be installed on your machine. If you're not running a Linux workstation you can install Docker for Mac.

Once Docker is installed you're ready to start. Open your terminal and download the cn binary.

macOS:

 -L https://github.com/ceph/cn/releases/download/v1.5.0/cn-v1.5.0-8fa7a91-darwin-amd64 -o cn && chmod +x cn

Linux:

 -L https://github.com/ceph/cn/releases/download/v1.5.0/cn-v1.5.0-8fa7a91-linux-amd64 -o cn && chmod +x cn

Test it out

cn
 Nano - One step S3 in container with Ceph.

              *(((((((((((((
            (((((((((((((((((((
          ((((((((*     ,(((((((*
         ((((((             ((((((
        *((((,               ,((((/
        ((((,     ((((((/     *((((
        ((((     (((((((((     ((((
        /(((     (((((((((     ((((
         (((.     (((((((     /(((/
          (((                *((((
          .(((              (((((
     ,(((((((*             /(((
      .(((((  ((( (/  //   (((
             /(((.  /(((((  /(((((
                    .((((/ (/

e:
 [command]

lable Commands:
uster      Interact with a particular Ceph cluster
           Interact with a particular S3 object server
age        Interact with cn's container image(s)
rsion      Print the version of cn
be         Outputs cn kubernetes template (cn kube > kube-cn.yml)
date-check Print cn current and latest version number
lp         Help about any command

s:
, --help   help for cn

"cn [command] --help" for more information about a command.
Get started

Start the program with a working directory /tmp, the initial start might take a few minutes since we need to download the container image:

cn cluster start -d /tmp my-first-cluster
ing ceph-nano...
container image is not present, pulling it.
 operation can take a few minutes......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

TH_OK is the Ceph status
 working directory is: /tmp
ccess key is: 4EO5O2IP4LSGSBC8CUG3
ecret key is: Ap8ue6ait0MqgnCIKT7UrCRJGLUoyBhtS2McbNxE
bject server address is: http://10.36.116.164:8001
 Nano browser address is: http://10.36.116.164:5001
Your first S3 bucket

Create a bucket with cn:

cn s3 mb my-first-cluster my-buc
et 's3://my-buc/' created

cn s3 put my-first-cluster /etc/passwd my-buc
ad: '/tmp/passwd' -> 's3://my-buc/passwd'  [1 of 1]
5 of 5925   100% in    1s     4.57 kB/s  done
Multi-cluster support

cn can manage any number of clusters on your local machine:

cn cluster ls
---+---------+-------------------------------------------------------------------------------------+----------------+--------------------------------+
ME | STATUS  | IMAGE                                                                               | IMAGE RELEASE  | IMAGE CREATION TIME            |
---+---------+-------------------------------------------------------------------------------------+----------------+--------------------------------+
   | running | ceph/daemon:latest                                                                  | master-77e3d8d | 2018-04-05T15:01:40.323603472Z |
   | running | ceph/daemon@sha256:369867e450ccdea9bcea7f54e97ed8b2cb1a0437fbef658d2d01fce2b8a2c648 | master-5f44af9 | 2018-03-30T21:08:31.117367166Z |
---+---------+-------------------------------------------------------------------------------------+----------------+--------------------------------+
List Ceph container images available

cn can list the available Ceph container image tag available:

cn image ls
st
er-a104cb7-jewel-ubuntu-16.04-x86_64
er-a104cb7-kraken-ubuntu-16.04-x86_64
er-a104cb7-jewel-ubuntu-14.04-x86_64
er-a104cb7-kraken-centos-7-x86_64
er-a104cb7-luminous-centos-7-x86_64
er-a104cb7-luminous-ubuntu-16.04-x86_64
er-a104cb7-jewel-centos-7-x86_64
er-5f44af9-kraken-ubuntu-16.04-x86_64
er-5f44af9-kraken-centos-7-x86_64

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.