This repository was archived by the owner on Apr 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
BMI on Travis for CI #119
Merged
Merged
BMI on Travis for CI #119
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # 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 .git/ /home/bmi/.git | ||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 coverage==4.3 pytest-cov coveralls | ||
|
|
||
| # 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| [](https://travis-ci.org/CCI-MOC/ims) | ||
| [](https://coveralls.io/github/CCI-MOC/ims?branch=dev) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess, you need to separate the coverage part out as it is not part of BMI CI. You may be running CI to get coverage report but that wasn't explicitly mentioned in issue. So the steps would be to
|
||
| # BMI | ||
|
|
||
| The Bare Metal Imaging (BMI) is a core component of the Massachusetts Open Cloud and an Image Management System(IMS) that | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this file used anywhere.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knikolla This is the file is used to build the docker image that is pulled in the yaml file. I'll add a comment on top saying the same.