Skip to content

Commit

Permalink
Testing junk - some might be good though.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Apr 2, 2020
1 parent bc893bf commit 6acc818
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
9 changes: 8 additions & 1 deletion lib/galaxy/jobs/runners/pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ def url_to_destination(self, url):
return JobDestination(runner="pulsar", params=url_to_destination_params(url))

def check_watched_item(self, job_state):
if self.use_mq:
return job_state
else:
return self.check_watched_item_state(job_state)

def check_watched_item_state(self, job_state):
try:
client = self.get_client_from_state(job_state)
status = client.get_status()
Expand Down Expand Up @@ -824,6 +830,7 @@ def __build_metadata_configuration(self, client, job_wrapper, remote_metadata, r
return metadata_kwds

def __async_update(self, full_status):
log.info("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n IN AN UPDATE \n\n\n\n\n\n\n\n\n\n")
galaxy_job_id = None
try:
remote_job_id = full_status["job_id"]
Expand Down Expand Up @@ -869,7 +876,7 @@ class PulsarMQJobRunner(PulsarJobRunner):
"default_file_action": "remote_transfer",
"rewrite_parameters": "true",
"jobs_directory": "/pulsar_staging",
"pulsar_container_image": "galaxy/pulsar-pod-staging:0.13.0",
"pulsar_container_image": "galaxy/pulsar-pod-staging:0.14.0dev6",
"remote_container_handling": True,
"k8s_enabled": True,
"url": PARAMETER_SPECIFICATION_IGNORED,
Expand Down
20 changes: 13 additions & 7 deletions test/integration/test_kubernetes_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)

TOOL_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'tools'))
GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST = os.environ.get("GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST", "SOCKET_HOSTNAME")
GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST = os.environ.get("GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST", "DOCKER_INTERNAL")
AMQP_URL = integration_util.AMQP_URL


Expand Down Expand Up @@ -245,27 +245,33 @@ def test_mulled_simple(self):


def set_infrastucture_url(config):
host = get_infrastructure_host()
infrastructure_url = "http://%s:$UWSGI_PORT" % host
config["galaxy_infrastructure_url"] = infrastructure_url


def get_infrastructure_host():
host = GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST
if host == "DOCKER_INTERNAL":
host = "host.docker.internal"
elif host == "SOCKET_HOSTNAME":
host = socket.gethostname()
elif host == "SOCKET_FQDN":
host = socket.getfqdn()
infrastructure_url = "http://%s:$UWSGI_PORT" % host
config["galaxy_infrastructure_url"] = infrastructure_url
return host


def to_infrastructure_uri(uri):
# remap MQ or file server URI hostnames for in-container versions, this is sloppy
# should actually parse the URI and rebuild with correct host
# similar code found in Pulsar integration_tests.py.
host = get_infrastructure_host()
infrastructure_uri = uri
if GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST:
if host:
if "0.0.0.0" in infrastructure_uri:
infrastructure_uri = infrastructure_uri.replace("0.0.0.0", GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST)
infrastructure_uri = infrastructure_uri.replace("0.0.0.0", host)
elif "localhost" in infrastructure_uri:
infrastructure_uri = infrastructure_uri.replace("localhost", GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST)
infrastructure_uri = infrastructure_uri.replace("localhost", host)
elif "127.0.0.1" in infrastructure_uri:
infrastructure_uri = infrastructure_uri.replace("127.0.0.1", GALAXY_TEST_KUBERNETES_INFRASTRUCTURE_HOST)
infrastructure_uri = infrastructure_uri.replace("127.0.0.1", host)
return infrastructure_uri

0 comments on commit 6acc818

Please sign in to comment.