From 6acc818c57ab730deb916b78ba8d54d9a9961a77 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 2 Apr 2020 09:52:58 -0400 Subject: [PATCH] Testing junk - some might be good though. --- lib/galaxy/jobs/runners/pulsar.py | 9 ++++++++- test/integration/test_kubernetes_staging.py | 20 +++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/jobs/runners/pulsar.py b/lib/galaxy/jobs/runners/pulsar.py index 114c8824ec97..9f1087df1bf8 100644 --- a/lib/galaxy/jobs/runners/pulsar.py +++ b/lib/galaxy/jobs/runners/pulsar.py @@ -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() @@ -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"] @@ -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, diff --git a/test/integration/test_kubernetes_staging.py b/test/integration/test_kubernetes_staging.py index c913d77dcbca..fbd1b62d2609 100644 --- a/test/integration/test_kubernetes_staging.py +++ b/test/integration/test_kubernetes_staging.py @@ -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 @@ -245,6 +245,12 @@ 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" @@ -252,20 +258,20 @@ def set_infrastucture_url(config): 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