Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into issue-40
Browse files Browse the repository at this point in the history
  • Loading branch information
felixApplatix committed Aug 28, 2017
2 parents c75abcc + 38c8739 commit 6c2f510
Show file tree
Hide file tree
Showing 16 changed files with 307 additions and 676 deletions.
20 changes: 10 additions & 10 deletions .argo/argo-saas-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ steps:
template: saas-unit-test-base
arguments:
parameters.COMMAND: /src/saas/common/run-test.sh
#AXAMM-TEST:
# template: saas-unit-test-base
# arguments:
# parameters.COMMAND: /src/saas/axamm/run-test.sh
AXAMM-TEST:
template: saas-unit-test-base
arguments:
parameters.COMMAND: /src/saas/axamm/run-test.sh
AXNC-TEST:
template: saas-unit-test-base
arguments:
Expand All @@ -31,10 +31,10 @@ steps:
template: saas-unit-test-base
arguments:
parameters.COMMAND: /src/saas/axops/run-test-event.sh
#MODULES-TEST-1:
# template: saas-unit-test-base
# arguments:
# parameters.COMMAND: /src/saas/axops/run-test-modules-1.sh
MODULES-TEST-1:
template: saas-unit-test-base
arguments:
parameters.COMMAND: /src/saas/axops/run-test-modules-1.sh
MODULES-TEST-2:
template: saas-unit-test-base
arguments:
Expand All @@ -45,8 +45,8 @@ outputs:
from: "%%steps.AXOPS-TEST.outputs.artifacts.COVERAGE-REPORT%%"
coverage-report-axdb:
from: "%%steps.AXDB-TEST.outputs.artifacts.COVERAGE-REPORT%%"
#coverage-report-axamm:
# from: "%%steps.AXAMM-TEST.outputs.artifacts.COVERAGE-REPORT%%"
coverage-report-axamm:
from: "%%steps.AXAMM-TEST.outputs.artifacts.COVERAGE-REPORT%%"
coverage-report-axnc:
from: "%%steps.AXNC-TEST.outputs.artifacts.COVERAGE-REPORT%%"

Expand Down
2 changes: 1 addition & 1 deletion .argo/test-yamls/pod-throughput-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: quick-exit
description: does nothing and exits quickly
resources:
mem_mib: 32
cpu_cores: 0.1
cpu_cores: 0.01
image: alpine:latest
command: ["sh", "-c", "exit 0"]

Expand Down
27 changes: 14 additions & 13 deletions platform/source/lib/ax/platform/axmon_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,43 @@ def task_create(self, data):
conf = Task.insert_defaults(data)
dry_run = data.get("dry_run", False)
if dry_run:
name = Task.generate_job_name(conf)
name = Task.generate_name(conf)
logger.debug("task_create: dry_run name is {}".format(name))
return {"{}".format(name): KubeObjStatusCode.OK}

# create the workflow
task = Task()
task_id = Task.generate_name(conf)
task = Task(task_id)
job_obj = task.create(conf)
task.start(job_obj)
return {"{}".format(task.jobname): KubeObjStatusCode.OK}
return {"{}".format(task.name): KubeObjStatusCode.OK}

def task_show(self, task_id):
if task_id is None:
raise ValueError("task id must be specified")
task = Task()
return task.status(task_id)
task = Task(task_id)
return task.status()

def task_delete(self, task_id, delete_pod, force):
logger.debug("Deleting task %s delete_pod=%s force=%s", task_id, delete_pod, force)
def task_delete(self, task_id, force):
logger.debug("Deleting task %s force=%s", task_id, force)
if task_id is None:
raise ValueError("task id must be specified")
task = Task()
return task.delete(task_id, delete_pod=delete_pod, force=force)
task = Task(task_id)
return task.delete(force=force)

def task_stop_running_pod(self, task_id):
logger.debug("Stopping task %s", task_id)
if task_id is None:
raise ValueError("task id must be specified")
task = Task()
return task.stop_running_pod(task_id)
task = Task(task_id)
return task.stop()

def task_log(self, task_id):
logger.debug("Getting log endpoint for %s", task_id)
if task_id is None:
raise ValueError("task id must be specified")
task = Task()
return task.get_log_endpoint(task_id)
task = Task(task_id)
return task.get_log_endpoint()

def add_registry(self, server, username, password, save=True):
client = AXDockerClient()
Expand Down
11 changes: 0 additions & 11 deletions platform/source/lib/ax/platform/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,6 @@ def get_main_container_name(self):

raise AXPlatformException("Pod for a task needs to have a non-wait container")

def _delete_volumes_for_pod(self, status):
# TODO: Disable this for now. We need a better solution than a hard delete of volumes
# This delete is right now commented out as it is deleting all volumes including volumes
# attached via volume pool
# for volume in status.spec.volumes:
# assert isinstance(volume, swagger_client.V1Volume), "Expect an object of type V1Volume"
# pvc = volume.persistent_volume_claim
# if pvc is not None and not pvc.read_only:
# VolumeManager().delete(pvc.claim_name)
pass

def _get_status_obj(self):
status = self.client.api.read_namespaced_pod_status(self.namespace, self.name)
assert isinstance(status, swagger_client.V1Pod), "Status object should be of type V1Pod"
Expand Down
2 changes: 1 addition & 1 deletion platform/source/lib/ax/platform/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def task_delete(task_id):
if stop_running_pod_only == "True":
result = axmon.task_stop_running_pod(task_id)
else:
result = axmon.task_delete(task_id, delete_pod=delete_pod == "True", force=force == "True")
result = axmon.task_delete(task_id, force=force == "True")
return jsonify(result=result)

@_app.route("/v1/axmon/task/<task_id>/logs", methods=['GET'])
Expand Down
Loading

0 comments on commit 6c2f510

Please sign in to comment.