alan-turing-institute / science-gateway-middleware

Middleware endpoints for the Science Gateway project
https://github.com/alan-turing-institute/science-gateway
MIT License
3 stars 0 forks source link

Azure middleware deployment #39

Open masonlr opened 7 years ago

masonlr commented 7 years ago

Currently at commit 3089a08dbed59418ba47970f18b7ad092a052c1a POST api/run/<job-id> returns

{
    "stdout": "",
    "exit_code": 0,
    "stderr": "run.sh: line 2: $'\\r': command not found\nqsub:  script is written in DOS/Windows text format\n"
}
masonlr commented 7 years ago

Running the following conversion isn't fixing this issue:

dos2unix run.sh

My mistake, dos2unix pbs.sh is the fix for this.

masonlr commented 7 years ago

7631f90 converts line endings by calling dos2unix on every file that is transferred by the middleware. Note that binary files will be skipped automatically by dos2unix.

masonlr commented 7 years ago

Now using http://dev-science-gateway-middleware.azurewebsites.net as a development site for middleware functionality. This is to avoid waiting on Travis/AppVeyor tests to pass and enable faster development.

masonlr commented 7 years ago

Having an issue when pushing from a non-master branch. Eg. see below. I've pushed from wip-job-action-development but the updates don't transfer across. Azure replies remote: Updating branch 'master'.

# 09:20 am [0] [science-gateway-middleware_j1_development_middleware] $ git push dev-azure wip-job-action-development
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 303 bytes | 303.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id 'b655442a80'.
# 09:23 am [0] [science-gateway-middleware_j1_development_middleware] $ git remote -v
dev-azure   https://gateway-admin@dev-science-gateway-middleware.scm.azurewebsites.net/Dev-Science-Gateway-Middleware.git (fetch)
dev-azure   https://gateway-admin@dev-science-gateway-middleware.scm.azurewebsites.net/Dev-Science-Gateway-Middleware.git (push)
origin  git@github.com:alan-turing-institute/science-gateway-middleware.git (fetch)
origin  git@github.com:alan-turing-institute/science-gateway-middleware.git (push)

In contrast, if a add a file to my local master branch and push, everything behaves as expected.

masonlr commented 7 years ago

Maybe of relevance: https://github.com/travis-ci/dpl/pull/392

masonlr commented 7 years ago

Okay, the solution is to run

git push dev-azure wip-job-action-development:master
masonlr commented 7 years ago

Note that pushing to azure via git push dev-azure wip-job-action-development:master does not wipe the database file (middleware/database/jobs.db).