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 14, 2020
1 parent adb0e86 commit 57e718a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/galaxy/jobs/runners/pulsar.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,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
20 changes: 13 additions & 7 deletions test/integration/test_kubernetes_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from .test_local_job_cancellation import CancelsJob

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
GALAXY_TEST_KUBERNETES_NAMESPACE = os.environ.get("GALAXY_TEST_K8S_NAMESPACE", "default")

Expand Down Expand Up @@ -246,27 +246,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 57e718a

Please sign in to comment.