-
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?
Conversation
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.
Just a few questions, otherwise it looks fine.
|
||
WORKDIR /home/hil/hil | ||
|
||
RUN git reset --hard f88d2fc92066c1e83e428ebeeca351971f306053 |
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.
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 |
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
# 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 = |
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.
BMI can work with database authentication, in fact there are some tests in BMI that check for that.
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.
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
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.
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 & |
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.
the command is hil-admin serve-networks
we have dashes everywhere instead of an underscore.
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.
huh, makes me wonder why this even works then
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 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
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 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.
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'll take out the gunicorn bit and see if the server is still running
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.
There must be some magic going on here because if I take out the gunicorn server I can't curl to hil at all
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.
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.
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.
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 & |
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.
kind of confused, why are you running it here again when you already run gunicorn on port 7000 in runhi.sh
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.
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
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.
wouldn't this complain that the something is already running on port 7000?
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.
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
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.
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.
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 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
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.
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 & |
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.
same thing with this guy.
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.
Looks good to me
We need to rebase this. |
Now it'll be easy to know just what's in the HIL CI container. To test,
cd
to thehil_container
directory and runsudo docker build -t hil-v03 .