Skip to content

Commit

Permalink
Merge branch 'develop' into issue806
Browse files Browse the repository at this point in the history
  • Loading branch information
kmehant authored May 16, 2020
2 parents 732cf42 + 4996282 commit 300655b
Show file tree
Hide file tree
Showing 44 changed files with 593 additions and 161 deletions.
26 changes: 12 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@ sudo: required
services:
- docker

before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(.md)|(.png)|(.)|^(LICENSE)|^(docs)|^(robots.txt)|^(package-list-yum)|^(package-list-pacman)|^(package-list-dnf)|^(package-list-brew)|^(package-list-aptget)|^(humans.txt)|^(docker-compose.yml)|^(docker-compose.dev.yml)|^(bassa)|^(.gitignore)|^(.gitattributes)|^(bassa-ui.yaml)|^(bassa-ingress.yaml)|^(bassa-api.yaml)|^(deploy_rds.sh)|^(rds-dev.json)|^(template.json)|^(setup-mysql.sh)|^(setup-database.sh)|^(create-schema.sh)|^(Bassa.sql)'
then
echo "Files changed not related to dockerfile, therefore travis build ends"
exit
fi

script:
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-ui ui
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa components/core
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-prod-ui ui
- docker build -f ui/Dockerfile.dev --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-dev-ui ui
- docker build -f components/core/Dockerfile.prod --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-prod-server components/core
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-dev-server components/core
- docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` -t scoreucsc/bassa-aria2c components/aria2c


after_success:
- if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then
- if [ "$TRAVIS_BRANCH" == "develop" -a "$TRAVIS_PULL_REQUEST" == "true" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
docker push scoreucsc/bassa;
curl -X POST 'https://hooks.microbadger.com/images/scoreucsc/bassa/Wbi5zehDMooS3ri2bgC8LETGGuQ=';
docker push scoreucsc/bassa-ui;
curl -X POST 'https://hooks.microbadger.com/images/scoreucsc/bassa-ui/et6pa2aJq-tEvwFoW-PL8ixNxr0=';
docker push scoreucsc/bassa-prod-ui;
docker push scoreucsc/bassa-dev-ui;
docker push scoreucsc/bassa-prod-server;
docker push scoreucsc/bassa-dev-server
docker push scoreucsc/bassa-aria2c;
fi

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<hr>

![logo](http://gdurl.com/7XYK)
![Bassa logo](https://github.com/scorelab/Bassa/blob/master/ui/src/assets/images/bassa.png?raw=true)

[![Build Status](https://travis-ci.org/scorelab/Bassa.svg?branch=master)](https://travis-ci.org/scorelab/Bassa)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7de63c7b9a69448787e8014a12a260b1)](https://www.codacy.com/app/SCoRe-Lab/Bassa?utm_source=github.com&utm_medium=referral&utm_content=scorelab/Bassa&utm_campaign=badger)
Expand Down Expand Up @@ -54,9 +54,8 @@ You can also discuss about other projects on [SCoRe Lab gitter channel](https://

## Contributors

This project exists thanks to all the people who contribute.
<a href="https://opencollective.com/Bassa#contributors" target="_blank"><img src="https://opencollective.com/Bassa/contributors.svg?width=890&button=false" /></a>

This project exists thanks to all the people who contribute.
[![Contributors Image](https://opencollective.com/Bassa/contributors.svg?width=890&button=false)](https://opencollective.com/Bassa#contributors)

## Backers

Expand Down
8 changes: 4 additions & 4 deletions components/aria2c/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:edge
FROM alpine:3

# Defining dockerfile maintainer
MAINTAINER SCoRe Lab Community <[email protected]>
Expand All @@ -15,13 +15,13 @@ RUN apk update && \
EXPOSE 6800

# Volume for storing the downloaded data
VOLUME [ "/data" ]
VOLUME [ "/downloads" ]

# Changing the current directory to data so that the files get downloaded there
WORKDIR /data
WORKDIR /downloads

# Starting the Aria2c RPC server
CMD ["aria2c", "--enable-rpc", "--rpc-listen-all"]
CMD ["aria2c", "--enable-rpc=true", "--rpc-listen-all", "--no-conf=true", "--disable-ipv6", "--console-log-level=debug"]

# Labels for dockerfile information
LABEL scorelab.bassa.name="Aria2c RPC server" \
Expand Down
9 changes: 7 additions & 2 deletions components/core/DownloadDaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from EMail import send_mail
from DiskMan import *
from ConfReader import get_conf_reader
from MinioHandler import *
import logging
from MinioHandler import *

import websocket
import sys
Expand Down Expand Up @@ -85,6 +85,9 @@ def worker(self):
data = json.loads(message)
print(threading.current_thread().name,data)
print ("TOP LEVEL DATA", data)
if 'error' in data:
logging.error("Aria2c error: %s", data['error'])
return
if 'id' in data and data['id'] == "act":
toBeDownloaded = get_to_download()
if toBeDownloaded:
Expand Down Expand Up @@ -177,6 +180,7 @@ def add_uri(ws, download):
def get_status(ws, id=None, gid=None):
if id:
gid = get_gid_from_id(id)
gid = str(gid)
msg = JSONer("stat", 'aria2.tellStatus', [gid, ['gid', 'files']])
print ("Getting status")
ws.send(msg)
Expand Down Expand Up @@ -235,7 +239,7 @@ def on_message(ws, message):
messageQueue.put(message)

def on_error(ws, error):
print(error)
logging.error(error)


def on_close(ws):
Expand All @@ -250,6 +254,7 @@ def starter(socket):
sc = socket
remove_files(conf['max_age'], conf['min_rating'])
folder_size=get_size(conf['down_folder'])
logging.info("SERVER: folder_size: %d", folder_size)
websocket.enableTrace(False)
ws = websocket.WebSocketApp(conf['aria_server'],
on_message=on_message,
Expand Down
Loading

0 comments on commit 300655b

Please sign in to comment.