Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Commit

Permalink
Changed TGT version (+5 squashed commits)
Browse files Browse the repository at this point in the history
Squashed commits:
[639b713] Fixed tgt
[57c9d09] test
[2a588f7] Changed to centos
[a177944] Added ceph tag
[8b29689] CI Final Commit (+1 squashed commit)
Squashed commits:
[50097a9] Commented docker files (+1 squashed commit)
Squashed commits:
[e4c0f50] Added comments (+6 squashed commits)
Squashed commits:
[14e426c] Update images
[876b6bd] Repo change
[2ae8ab0] Added new lines
[314830d] Changed to docker hub
[51c5d61] Added build status
[2faa0b0] Dockerfile for environment (+1 squashed commit)
Squashed commits:
[c338292] Travis
  • Loading branch information
chemistry_sourabh authored and chemistry-sourabh committed Jun 22, 2017
1 parent 003737b commit 3e8098a
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,42 @@ language: python
python:
- "2.7"

sudo: required

install:
- pip install pep8

script:
services:
- docker

before_script:
# Run pep8 on all .py files in all subfolders
# ignore E402: module level import not at top of file
- find . -name \*.py -exec pep8 --ignore=E402 {} +

# Run Ceph Container and Wait for some time so that ceph runs
- sudo docker run -d -v ceph:/etc/ceph -e MON_IP=172.17.0.2 -e CEPH_PUBLIC_NETWORK=172.17.0.0/24 --name ceph ceph/demo:tag-build-master-hammer-centos-7
- sleep 30

# Run HIL Container
- sudo docker run -d --name hil bmis/hil

# Build BMI Container From Environment Image
- sudo docker pull bmis/bmi-ci
- sudo docker build -t bmi-test -f Dockerfile_ci .
- sudo docker run -d -v ceph:/etc/ceph --name bmi bmi-test

# Just for debugging purposes to check if all containers run
- sudo docker ps

# Insert Image into Ceph using ceph client in BMI Container
- sudo docker exec bmi rbd create --image-format 2 --size 10 bmi_test

script:
# Run Tests in BMI container
- sudo docker exec bmi pytest -v --random-order-bucket=global --ignore tests/unit/picasso tests/

after_script:
# Extract and Upload logs for debugging incase of failure
- sudo docker cp bmi:/var/log/bmi/ims.log ./ims.log
- curl -sT ./ims.log chunk.io
23 changes: 23 additions & 0 deletions Dockerfile_ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This will be by CI tool to build BMI image that will be used for testing.

# Basing on image stored in docker hub for faster build
FROM bmis/bmi-ci

# Copy source code
USER bmi
COPY ims/ /home/bmi/ims/
COPY tests/ /home/bmi/tests/
COPY scripts/ /home/bmi/scripts/
COPY setup.py /home/bmi/setup.py

# Install
USER root
WORKDIR /home/bmi
RUN python setup.py develop

# Create DB
USER bmi
RUN bmi db ls

# Start dependencies when container starts
CMD dumb-init /home/bmi/runbmi.sh
47 changes: 47 additions & 0 deletions Dockerfile_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This File is to create the image for BMI environment.
# It will install all dependencies and create the required folder structure
# The CI Tool will just create a new image based of this and run tests

# Using ubuntu as base
FROM ubuntu

# Install all dependencies except dnsmasq
RUN apt-get -y update && apt-get install -y tgt-rbd ceph-common python python-dev python-setuptools build-essential python-pip sudo sqlite3 git

# Install test stuff
RUN pip install dumb-init pytest pytest-random-order

# Create user and remove password for root
RUN useradd -ms /bin/bash bmi
RUN passwd -d bmi
RUN passwd -d root
RUN usermod -aG sudo bmi

# Create required folders
RUN mkdir /etc/bmi/
RUN mkdir /var/log/bmi/
RUN mkdir /var/lib/tftpboot/
RUN mkdir /var/lib/tftpboot/pxelinux.cfg/
RUN mkdir /var/lib/bmi/

# Add config file
COPY docker/bmi_config.cfg /etc/bmi/bmiconfig.cfg
ENV BMI_CONFIG=/etc/bmi/bmiconfig.cfg

# Set Permissions
RUN chown bmi:bmi /etc/tgt/conf.d/
RUN chown bmi:bmi /var/log/bmi/
RUN chown bmi:bmi /var/lib/tftpboot/
RUN chown bmi:bmi /var/lib/tftpboot/pxelinux.cfg/
RUN chown bmi:bmi /var/lib/bmi/

# Add the BMI execute script
COPY docker/runbmi.sh /home/bmi/runbmi.sh
RUN chmod a+x /home/bmi/runbmi.sh

# Set Environment variables
ENV HAAS_USERNAME=admin
ENV HAAS_PASSWORD=admin

# Expose as volume to get keyring and ceph config
VOLUME /etc/ceph
58 changes: 58 additions & 0 deletions Dockerfile_env_centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This File is to create the image for BMI environment.
# It will install all dependencies and create the required folder structure
# The CI Tool will just create a new image based of this and run tests

# Using ubuntu as base
FROM centos

# Install all dependencies except dnsmasq
RUN yum install -y epel-release
RUN rpm --import 'https://download.ceph.com/keys/release.asc'
COPY docker/yum.repo /etc/yum.repos.d/ceph.repo
RUN yum -y update && yum install -y ceph-common-0.94.9 librbd1-devel-0.94.9 librados2-devel-0.94.9 python python-setuptools python-pip sudo sqlite cpan perl-Config-General libxslt-devel git make gcc

# Install test stuff
RUN pip install dumb-init pytest pytest-random-order coverage==4.3 pytest-cov coveralls

RUN git clone https://github.com/fujita/tgt
WORKDIR tgt/
RUN git reset --hard 3c8c9e96b82d87a334b1d340fa29218b7b94f26d
RUN sudo make CEPH_RBD=1 clean
RUN sudo make CEPH_RBD=1
RUN sudo make CEPH_RBD=1 install

WORKDIR ../
# Create user and remove password for root
RUN useradd -ms /bin/bash bmi
RUN passwd -d bmi
RUN passwd -d root
RUN usermod -aG wheel bmi

# Create required folders
RUN mkdir /etc/bmi/
RUN mkdir /var/log/bmi/
RUN mkdir /var/lib/tftpboot/
RUN mkdir /var/lib/tftpboot/pxelinux.cfg/
RUN mkdir /var/lib/bmi/

# Add config file
COPY docker/bmi_config.cfg /etc/bmi/bmiconfig.cfg
ENV BMI_CONFIG=/etc/bmi/bmiconfig.cfg

# Set Permissions
RUN chown bmi:bmi /etc/tgt/conf.d/
RUN chown bmi:bmi /var/log/bmi/
RUN chown bmi:bmi /var/lib/tftpboot/
RUN chown bmi:bmi /var/lib/tftpboot/pxelinux.cfg/
RUN chown bmi:bmi /var/lib/bmi/

# Add the BMI execute script
COPY docker/runbmi.sh /home/bmi/runbmi.sh
RUN chmod a+x /home/bmi/runbmi.sh

# Set Environment variables
ENV HAAS_USERNAME=admin
ENV HAAS_PASSWORD=admin

# Expose as volume to get keyring and ceph config
VOLUME /etc/ceph
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Build Status](https://travis-ci.org/CCI-MOC/ims.svg?branch=dev)](https://travis-ci.org/CCI-MOC/ims)
# BMI

The Bare Metal Imaging (BMI) is a core component of the Massachusetts Open Cloud and an Image Management System(IMS) that
Expand Down
23 changes: 23 additions & 0 deletions docker/yum.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[ceph]
name=Ceph packages for $basearch
baseurl=https://download.ceph.com/rpm-hammer/el7/$basearch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

[ceph-noarch]
name=Ceph noarch packages
baseurl=https://download.ceph.com/rpm-hammer/el7/noarch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

[ceph-source]
name=Ceph source packages
baseurl=https://download.ceph.com/rpm-hammer/el7/SRPMS
enabled=0
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

0 comments on commit 3e8098a

Please sign in to comment.