Skip to content

Commit

Permalink
Revert submission of instance metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Aug 1, 2017
1 parent d453231 commit a0292a4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 33 deletions.
15 changes: 11 additions & 4 deletions scripts/grt-submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"""
from __future__ import print_function

import argparse
import os
import sys
import json
import urllib2
import argparse
import time
import yaml
import re
import logging
import urllib2

sample_config = os.path.abspath(os.path.join(os.path.dirname(__file__), 'grt.yml.sample'))
default_config = os.path.abspath(os.path.join(os.path.dirname(__file__), 'grt.yml'))
Expand All @@ -37,9 +37,16 @@ def main(argv):
with open(sample_config) as handle:
config = yaml.load(handle)

REPORT_DIR = args.report_directory
CHECK_POINT_FILE = os.path.join(REPORT_DIR, '.checkpoint')
ARCHIVE_DIR = os.path.join(REPORT_DIR, 'archives')
METADATA_FILE = os.path.join(REPORT_DIR, 'meta.json')
REPORT_BASE = os.path.join(ARCHIVE_DIR, REPORT_IDENTIFIER)

GRT_URL = config['grt']['url']
GRT_INSTANCE_ID = config['grt']['instance_id']
GRT_API_KEY = config['grt']['api_key']
# Contact the server and check auth details.

# TODO: server interaction.

Expand Down
10 changes: 2 additions & 8 deletions scripts/grt.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ def main(argv):
REPORT_DIR = args.report_directory
CHECK_POINT_FILE = os.path.join(REPORT_DIR, '.checkpoint')
ARCHIVE_DIR = os.path.join(REPORT_DIR, 'archives')
METADATA_FILE = os.path.join(REPORT_DIR, 'meta.json')
REPORT_IDENTIFIER = str(time.time())
REPORT_BASE = os.path.join(ARCHIVE_DIR, REPORT_IDENTIFIER)

Expand All @@ -200,7 +199,7 @@ def main(argv):
last_job_sent = -1

logging.info('Loading Galaxy...')
model, object_store, engine, gxconfig, app = _init(config['galaxy_config'], need_app=config['grt']['metadata']['share_toolbox'])
model, object_store, engine, gxconfig, app = _init(config['galaxy_config'], need_app=config['grt']['share_toolbox'])

sa_session = model.context.current
logging.info('Configuration Loaded')
Expand Down Expand Up @@ -285,11 +284,6 @@ def main(argv):
if os.path.exists(REPORT_DIR) and not os.path.exists(ARCHIVE_DIR):
os.makedirs(ARCHIVE_DIR)

_times.append(('job_meta_start', time.time() - _start_time))
with open(METADATA_FILE, 'w') as handle:
json.dump(config['grt']['metadata'], handle, indent=2)
_times.append(('job_meta_end', time.time() - _start_time))

with gzip.open(REPORT_BASE + '.tsv.gz', 'w') as handle:
for job in grt_jobs_data:
handle.write('\t'.join(job))
Expand All @@ -302,7 +296,7 @@ def main(argv):

# Now serialize the individual report data.
with open(REPORT_BASE + '.json', 'w') as handle:
if config['grt']['metadata']['share_toolbox']:
if config['grt']['share_toolbox']:
toolbox = [
(tool.id, tool.name, tool.version, tool.tool_shed, tool.repository_id, tool.repository_name)
for tool_id, tool in app.toolbox._tools_by_id.items()
Expand Down
28 changes: 7 additions & 21 deletions scripts/grt.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,16 @@ galaxy_config: config/galaxy.ini

grt:
# Go to https://telescope.galaxyproject.org to obtain an Instance ID and API key
instance_id: None
api_key: None
instance_id: 5f126e1d-d216-493e-a67a-3d6f20a0f1ac
api_key: 9e43e2b9-b54a-418c-9712-36e79f4d9183
# Galaxy Project offers a public galactic-radio-telescope instance, however
# you are free to run your own if you need. We would love it if you were
# willing and able to contribute your data publicly.
url: https://telescope.galaxyproject.org/
# Some metadata about your galaxy instance
metadata:
url: https://example.com/galaxy/
title: NLP Galaxy
description: |
This is our Galaxy instance!
# Is the instance open to the public?
public: False
# Optional Location
latitude: 0.00
longitude: 0.00
# Owners (these are the usernames of users registered with the galactic-radio-telescope system.)
owners:
- jane.doe
# Are you willing to share your toolbox? I.e. what tools are installed.
# If your instance is public, this can help us direct users to your
# instance.
share_toolbox: False
url: http://localhost:8080
# Are you willing to share your toolbox? I.e. what tools are installed.
# If your instance is public, this can help us direct users to your
# instance.
share_toolbox: False


blacklist:
Expand Down

0 comments on commit a0292a4

Please sign in to comment.