Skip to content

i1713: Fix path to password #16

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

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

i1713: Fix path to password #16

wants to merge 3 commits into from

Conversation

richfitz
Copy link
Member

Once this is merged, you will be able to do

jenner:datbase_connection("science")

and get a connection.

@xiangli313 - how should we update this so that it works most neatly from within an import script? Can you think of a good way of doing it detecting where we are so that the import.sh files can get a bit smaller again?

@richfitz richfitz requested a review from xiangli313 April 25, 2018 14:31
@xiangli313
Copy link
Contributor

I got an error message

con <- jenner::database_connection("science")
 Show Traceback
 
 Rerun with Debug
 Error in vault_addr(addr) : vault address not found 

I don't quite understand what you mean by saying "detecting where we are". Do you mean the hostname thing in the bash script?

@richfitz
Copy link
Member Author

Can you try again now please @xiangli313?

@xiangli313
Copy link
Contributor

xiangli313 commented Apr 27, 2018 via email

@richfitz
Copy link
Member Author

richfitz commented Apr 27, 2018

OK, now in import.sh scripts we'd do:

#!/usr/bin/env bash
set -ex

MONTAGU_NETWORK=montagu_default
MONTAGU_DOCKER=docker.montagu.dide.ic.ac.uk:5000
MONTAGU_DB_HOST=$(hostname)
MONTAGU_IMPORT_IMAGE=$MONTAGU_DOCKER/montagu-db-import:master
WORKDIR=/montagu-import

echo "*** Importing new 201801rft modelling group"
docker pull $MONTAGU_IMPORT_IMAGE
docker run --rm -it \
       --network $MONTAGU_NETWORK \
       -e MONTAGU_DB_HOST=$MONTAGU_DB_HOST \
       -u `id -u $USER` \
       -v ${PWD}:${WORKDIR} \
       -w ${WORKDIR} \
       ${MONTAGU_IMPORT_IMAGE} \
       Rscript --no-environ import.R

and within the import.R file we'd do

con <- jenner::database_connection(NULL, "import")

and that should wire everything up correctly.

For local testing you will need an .Renviron file containing MONTAGU_DB_HOST=science only

@xiangli313
Copy link
Contributor

I am setting the .Renviron as

MONTAGU_DB_HOST=science

then I got error message regarding authentication

con <- jenner::database_connection(NULL, "import")
Authenticating using github...
 Show Traceback
 
 Rerun with Debug
 Error: GET https://api.github.com/user: 401 Requires authentication [] 

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

Successfully merging this pull request may close these issues.

2 participants