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

Added hil ci container docker sources #191

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ianballou
Copy link
Collaborator

Now it'll be easy to know just what's in the HIL CI container. To test, cd to the hil_container directory and run sudo docker build -t hil-v03 .

Copy link
Contributor

@naved001 naved001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions, otherwise it looks fine.


WORKDIR /home/hil/hil

RUN git reset --hard f88d2fc92066c1e83e428ebeeca351971f306053
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can directly clone the tagged version instead of doing a git reset --hard
git clone https://github.com/cci-moc/hil -b v0.3


COPY hil.cfg /home/hil

COPY hil.cfg /home/hil/hil
Copy link
Contributor

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?

Copy link
Collaborator Author

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

# network allocator instead of the null allocator. To do this, comment out the
# null allocator extension above, and uncomment the following:
#
hil.ext.auth.null =
Copy link
Contributor

@naved001 naved001 Oct 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BMI can work with database authentication, in fact there are some tests in BMI that check for that.

Copy link
Collaborator Author

@ianballou ianballou Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't that mean we'll need to do a hil-admin call to add the first administrative user? bmi_infra I'm guessing
edit: found it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, we would have to bootstrap the database somewhere.

@@ -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 &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the command is hil-admin serve-networks we have dashes everywhere instead of an underscore.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, makes me wonder why this even works then

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for some reason upon exiting the bash script the two servers get killed. I tried to do a kill %1 %2 but it said there was nothing running

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it works.

[centos@hil etc]$ hil-admin serve_networks > /dev/null 2>&1 &
[1] 27435
[centos@hil etc]$ 
[centos@hil etc]$ 
[centos@hil etc]$ 
[1]+  Exit 2                  hil-admin serve_networks > /dev/null 2>&1

Since we push the output to /dev/null we don't see anything on screen. and it exits in a few seconds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take out the gunicorn bit and see if the server is still running

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be some magic going on here because if I take out the gunicorn server I can't curl to hil at all

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I wasn't clear. The gunicorn server is the api sever and that should stay. Without it, you won't be able to curl to hil at all (unless you are running the dev server using the hil-admin command).

The serve-networks command is the process that does the networking operations, if it's not running and you queue a networking operation, that operation wouldn't go through. You would still be able to curl to hil and do other things. so the bit that should get removed is hil-admin serve_networks... since that is a command which doesn't exist. And you are running the right command in setupdb.sh already.

Copy link
Collaborator Author

@ianballou ianballou Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right I get that, but I believe the two server commands I run in that setupdb script get killed somewhere along the way, which is why it's fine to first run them there, setup the db, then run the servers again at the end. Since the API is not reachable even within the container when taking out the gunicorn command, the original run-dev-server call along with serve-networks must be getting stopped. Also I fixed the serve-networks command to be correct in the latest commit

@@ -0,0 +1,27 @@
hil-admin run-dev-server -p 7000 &
Copy link
Contributor

Choose a reason for hiding this comment

The 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 runhi.sh

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

Copy link
Collaborator Author

@ianballou ianballou Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah probably has to do with why runhil.sh has the sleep infinity in it. I think when setupdb.sh exits even though there's the & it kills the servers.
Edit: might also be when I switch users the terminal closes


sleep 5

hil-admin serve-networks &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing with this guy.

Copy link
Contributor

@naved001 naved001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@naved001
Copy link
Contributor

We need to rebase this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants