-
Notifications
You must be signed in to change notification settings - Fork 16
Added hil ci container docker sources #191
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| FROM centos | ||
|
|
||
| RUN yum install -y epel-release | ||
|
|
||
| RUN yum -y update && yum install -y bridge-utils gcc httpd ipmitool libvirt libxml2-devel libxslt-devel mod_wsgi net-tools python-pip python-psycopg2 python-virtinst qemu-kvm telnet vconfig virt-install | ||
|
|
||
| RUN yum install -y git | ||
|
|
||
| RUN yum install -y python-devel | ||
|
|
||
| RUN pip install dumb-init | ||
|
|
||
| RUN useradd -ms /bin/bash hil | ||
|
|
||
| RUN passwd -d hil | ||
|
|
||
| RUN passwd -d root | ||
|
|
||
| RUN usermod -aG wheel hil | ||
|
|
||
| WORKDIR /home/hil | ||
|
|
||
| RUN git clone https://github.com/cci-moc/hil -b v0.3 | ||
|
|
||
| WORKDIR /home/hil/hil | ||
|
|
||
| RUN pip install --upgrade pip setuptools | ||
|
|
||
| RUN python setup.py install | ||
|
|
||
| COPY hil.cfg /etc/hil.cfg | ||
|
|
||
| COPY hil.cfg /home/hil/hil | ||
|
|
||
| USER hil | ||
|
|
||
| RUN hil-admin db create | ||
|
|
||
| USER root | ||
|
|
||
| RUN chmod 666 /home/hil/hil.db | ||
|
|
||
| RUN chown hil:hil /home/hil/hil.db | ||
|
|
||
| COPY setupdb.sh setupdb.sh | ||
|
|
||
| RUN chmod a+x setupdb.sh | ||
|
|
||
| USER hil | ||
|
|
||
| ENV HIL_ENDPOINT=http://127.0.0.1:7000 | ||
|
|
||
| RUN source ./setupdb.sh | ||
|
|
||
| USER root | ||
|
|
||
| RUN cp hil.wsgi wsgi.py | ||
|
|
||
| RUN pip install gunicorn | ||
|
|
||
| COPY runhil.sh runhil.sh | ||
|
|
||
| RUN chmod a+x runhil.sh | ||
|
|
||
| EXPOSE 7000 | ||
|
|
||
| user hil | ||
|
|
||
| CMD dumb-init /home/hil/hil/runhil.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| [general] | ||
| log_level = debug | ||
|
|
||
| [auth] | ||
| require_authentication = True | ||
|
|
||
| [headnode] | ||
| trunk_nic = eth0 | ||
| base_imgs = img1, img2, img3, img4 | ||
| libvirt_endpoint = qemu:///system | ||
|
|
||
| [client] | ||
| endpoint = http://127.0.0.1:7000 | ||
|
|
||
| [database] | ||
| uri = sqlite:////home/hil/hil.db | ||
| #uri = postgresql://<username>:<password>@<address>/<dbname> | ||
|
|
||
| [devel] | ||
| dry_run=True | ||
|
|
||
| [extensions] | ||
| hil.ext.switches.mock = | ||
| hil.ext.obm.mock = | ||
|
|
||
| #hil.ext.network_allocators.null = | ||
|
|
||
| # Depending on what you're trying to do, you may want to use the vlan_pool | ||
| # network allocator instead of the null allocator. To do this, comment out the | ||
| # null allocator extension above, and uncomment the following: | ||
| # | ||
| hil.ext.auth.database = | ||
| hil.ext.network_allocators.vlan_pool = | ||
|
|
||
| [hil.ext.network_allocators.vlan_pool] | ||
| vlans = 100-200, 300-500 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| nohup gunicorn -w 5 -b 0.0.0.0:7000 wsgi:application >/dev/null 2>&1 & | ||
| sleep 1 | ||
| nohup hil-admin serve-networks >/dev/null 2>&1 & | ||
| sleep infinity |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| export HIL_USERNAME=haasadmin | ||
|
|
||
| export HIL_PASSWORD=admin1234 | ||
|
|
||
| hil-admin run-dev-server -p 7000 & | ||
|
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. kind of confused, why are you running it here again when you already run gunicorn on port 7000 in
Collaborator
Author
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. This part is just to turn on hil so the database could get setup. I've tried to keep it close as possible to the old hil container setup too
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. wouldn't this complain that the something is already running on port 7000?
Collaborator
Author
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. well this bit gets run before the gunicorn server, so it should be the gunicorn one that's complaining. Since we throw out the output though I think we just don't see it
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. okay. I am fine with either running the flasks' built-in dev server (using the hil-admin command) or the gunicorn server. But we shouldn't run both because it leads to confusion and only one will fail anyway.
Collaborator
Author
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 think I address this in the thread above, but these commands in setupdb get killed somewhere along the way before gunicorn & the second serve-networks call
Collaborator
Author
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. Yeah probably has to do with why runhil.sh has the |
||
|
|
||
| sleep 5 | ||
|
|
||
| hil-admin serve-networks & | ||
|
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. same thing with this guy. |
||
|
|
||
| sleep 5 | ||
|
|
||
| hil-admin create-admin-user haasadmin admin1234 | ||
|
|
||
| hil project create bmi_infra | ||
|
|
||
| hil node register bmi_node mock mock-host mock-user mock-pass | ||
|
|
||
| hil node nic register bmi_node bmi_nic aa:bb:cc:dd:ee:ff | ||
|
|
||
| hil network create bmi_provision bmi_infra | ||
|
|
||
| hil project node add bmi_infra bmi_node | ||
|
|
||
| hil switch register bmi_switch mock mockhost mockuser mockpass | ||
|
|
||
| hil port register bmi_switch gi1/0/1 | ||
|
|
||
| hil port nic add bmi_switch gi1/0/1 bmi_node bmi_nic | ||
|
|
||
| hil node show bmi_node | ||
|
|
||
| hil network show bmi_provision | ||
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.
why are we copying it to three places?
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.
fixed this, only need it in two places