Skip to content

Commit

Permalink
Another attempt to fix periodic jobs. (#77)
Browse files Browse the repository at this point in the history
* GCS output for periodic jobs appears to be in kubernetes-jenkins/logs/mlkube-build-periodic
* Don't set PULL in started.json if its an empty string; this is causing the
  parse errors.
* Try to fix issue #76
  • Loading branch information
jlewi authored Oct 24, 2017
1 parent 7913375 commit 3e19cf5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions test-infra/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,20 @@ def get_gcs_output():
job=job_name,
build=os.getenv("BUILD_NUMBER"))
return output
else:
# It is a periodic or postsubmit job
elif os.getenv("REPO_OWNER"):
# It is a postsubmit job
output = ("gs://kubernetes-jenkins/logs/{owner}_{repo}/"
"{job}/{build}").format(
owner=GO_REPO_OWNER, repo=GO_REPO_NAME,
pull_number=pull_number,
job=job_name,
build=os.getenv("BUILD_NUMBER"))
return output

else:
# Its a periodic job
output = ("gs://kubernetes-jenkins/logs/{job}/{build}").format(
job=job_name,
build=os.getenv("BUILD_NUMBER"))
return output

def create_started(gcs_client, output_dir, sha):
"""Create the started output in GCS.
Expand All @@ -277,13 +281,16 @@ def create_started(gcs_client, output_dir, sha):
# For a list of fields expected by gubernator
started = {
"timestamp": int(time.time()),
"pull": os.getenv("PULL_REFS", ""),
"repos": {
# List all repos used and their versions.
GO_REPO_OWNER + "/" + GO_REPO_NAME: sha,
},
}

PULL_REFS = os.getenv("PULL_REFS", "")
if started:
started["pull"] = PULL_REFS

m = GCS_REGEX.match(output_dir)
bucket = m.group(1)
path = m.group(2)
Expand Down

0 comments on commit 3e19cf5

Please sign in to comment.