Closed miguelcleon closed 7 years ago
@miguelcleon Hang on tight on the Docker stuff right now. It used to work, but now it's broken, I am still trying to address the problem. Thanks.
Also, I put the wrong repo on docker hub, it should be continuumio/miniconda:latest
Yes that fixed building the image for the local dockerfile. However when I try to run an instance of the image im getting ImportError: No module named pytz
Maybe pytz just needs to be added to the requirements.txt file? I'm trying that now.
adding pytz (pytz=2017.2) to requirements.txt didn't work not sure why, when i manually create the conda environment like below it worked.
conda create --yes -n odm2adminenv2 -c conda-forge python=2.7 --file /ODM2-Admin/requirements.txt
@lsetiawan any chance you can take a look at this again soon? @emiliom ?
Miguel: Don and I chatted about this today. He's probably already in touch with you, but he's actively working on this now. I had diverted his work away from ODM2 Admin late last week (FYI, towards WOFpy), but that was at least partly based on a misunderstanding on my part of where things were.
@miguelcleon I've made a pull request, this would fix your errors, please merge. Thanks.
@lsetiawan Ok I published the new pre-release for docker hub https://github.com/miguelcleon/ODM2-Admin/releases/tag/v0.1001-alpha
@lsetiawan ok the latest release (v0.1003-alpha) now correctly uses a blank ODM2 database from docker, instead of the example DB which contains Luquillo data and shouldn't be used for this. One thing, you can't login without a superuser account setup and I'm not sure how to run python manage.py createsuperuser
within the docker container. Your supposed to run it interactively in order to set a password, otherwise it will try to email you a link to set your password, but I don't think we should try to set up smtp to make that work. I guess a the question really is how do you modify the contents of the docker container after it is setup? Someone should be able to get to the settings file to modify that as well. Do you know how to do that? Maybe @ocefpaf knows?
Ah, yes.
Once the application is in the background running, you can attach to the container by running:
docker exec -it containerid /bin/bash
, That will bring up a shell where you can activate the conda environment and run python manage.py migrate
and python manage.py createsuperuser
. I'll need to document that.
The next round of improvements are to allow user to
I was thinking to use the model like docker-erddap, where user attach volume within their host machine to specify where the settings files are, and we have some sort of template where we can let user to download and use... What do you think @ocefpaf ?
Yes, that worked :+1: I was able to run bash in docker, activate the conda environment and create a super user. Great, thanks!
@lsetiawan I went ahead and wrote it up. Maybe you could try this to make sure this works for you? https://github.com/miguelcleon/ODM2-Admin/commit/6ccd89a4406a5fd5b0ffb9f3d0876f11a8b3d83e
If that works let's close this issue and create a new one with the next round of improvements you outlined.
@lsetiawan So your talking about generating a settings file from some sort of template?
@miguelcleon yepp. basically zip the templatesAndSettings/settings
. I'll try out the new blank db in a bit.
ok, I made the readme more verbose https://github.com/miguelcleon/ODM2-Admin/commit/c3c3b4ec97b7b09b25327f7459d66604d04e1378
@lsetiawan I'm back and trying to run the docker container. It seems to work except the django tables are not in the odm2admindb.backup database. Either a migration needs to be ran on the backup database so that the django tables exist or the migrate command for manage.py needs to be ran I think in startup.sh
I was trying to do this on my own branch but docker can't seem to find my repo, maybe because I added -b miguelworking to point to the branch in the dockerfile git clone command. I also tried to build the image from the local Dockerfile but it is failing with the below, not sure why.