-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Dockerfile for LibraryMetricScripts and Pull librarycomparisonswebsite images from Docker Hub #43
base: master
Are you sure you want to change the base?
Conversation
updatemetrics.sh
Outdated
|
||
#pull latest repo changes | ||
git pull | ||
file_name="libcomp-bkp-${today}.sql" |
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.
can we at least put this in a DBBackups folder? Otherwise, it will be lots of files in the current directory
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.
@XiaoleZ So I guess based on our conversation, you should revert back all changes related to updatemetrics.sh
(i.e., it should be the original one before your changes since you won't be dealing with it)
hi @XiaoleZ As discussed, I've created a dockerhub organization https://hub.docker.com/orgs/ualbertasmr and added you as an owner. I've linked the ualberta-smr organization account to it. Can you see if you are able to push the container there now instead of using your personal account? Let me know if there are any issues! |
@snadi Thank you. I will put the images in the org docker hub |
scripts/Config.json
Outdated
@@ -8,5 +8,6 @@ | |||
"MAXSIZE": "1000", | |||
"POPULARITY_OUTPUT_FILE":"scripts/Popularity/popularity_results.txt", | |||
"TIME_SPAN":"365", | |||
"SO_TOKEN":"enter your SO token" | |||
"SO_TOKEN":"enter your SO token", | |||
"OUTPUT_PATH": "scripts/" |
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 changing output_path to |
I get this error when creating the metrics
I think that the domain tables haven't been created yet. So does this mean that the steps need to be done in reverse? That you need to run the migrate for the website first? |
Because the charts is in ../home/scripts/ (not in the metricscript or web container). The views.py read the charts from ../home/scripts/ . So the charts can be display on the web.' I move this change in the code. output_path = |
What it does?
Create Dockerfile for LibraryMetricScripts and Pull librarycomparisonswebsite images from Docker Hub
Why it is import?
It makes the database setup more easier and it allows the user to run librarycomparisonswebsite locally
How to test it?
Follow the updated Readme.md file.
Docker Local Development Setup
This is a simple way to get a local librarycomparison web development server set up.
You'll need to have Docker and Docker Compose installed.
You first need to set up some of the configuration parameters in the file
Config.json
:TOKEN
to your own GitHub generated token. (How to create Github TOKEN)SO_TOKEN
to your stack exchange key. (How to create StackOverflow TOKEN)You can update the
MAXSIZE
to 100 inConfig.json
for testing purpose.Creating the image
1. Builds/Rebuilds the image (not start the containers) in the docker-compose.yml file:
2. Starts the containers
Starts the containers && Start the server
Run metric script:
createmetrics
: Create the Metrics(Optional) Open librarycomparisons website command shell:
start
: Starts the Django server. The librarycomparison web will run in the8000
port by default.migrate
: Runs Django migrationsmake
: Runs Django makemigrationscreatesuperuser
: Runs Django createsuperuserTo access the website, use http://127.0.0.1:8000/comparelibraries/
3. Stops containers and removes containers, networks, volumes, and images created by up
Remove volume:
docker-compose down -v
. Warning: this will permanently delete the contents in the db_data volume, wiping out any previous database you had there4. Setup Metric Table if you create the docker volumn for the first time
Accessing docker container mysql databases
eg:
docker exec -it librarymetricscripts_db_1 mysql -uroot -p"mypwd"
show databases;