Write timestamps when important events happen during the compose (#409).
Right now, this is when the compose is queued up, when it is started by anaconda, and when it is finished (whether that's success or not).
This commit is contained in:
parent
17c40ef271
commit
3ba9d53b8b
@ -49,6 +49,7 @@ from pykickstart.version import makeVersion, RHEL7
|
|||||||
from pylorax.api.projects import projects_depsolve, projects_depsolve_with_size, dep_nevra
|
from pylorax.api.projects import projects_depsolve, projects_depsolve_with_size, dep_nevra
|
||||||
from pylorax.api.projects import ProjectsError
|
from pylorax.api.projects import ProjectsError
|
||||||
from pylorax.api.recipes import read_recipe_and_id
|
from pylorax.api.recipes import read_recipe_and_id
|
||||||
|
from pylorax.api.timestamp import write_timestamp
|
||||||
from pylorax.imgutils import default_image_name
|
from pylorax.imgutils import default_image_name
|
||||||
from pylorax.sysutils import joinpaths
|
from pylorax.sysutils import joinpaths
|
||||||
|
|
||||||
@ -384,6 +385,7 @@ def start_build(cfg, yumlock, gitlock, branch, recipe_name, compose_type, test_m
|
|||||||
if test_mode > 0:
|
if test_mode > 0:
|
||||||
open(joinpaths(results_dir, "TEST"), "w").write("%s" % test_mode)
|
open(joinpaths(results_dir, "TEST"), "w").write("%s" % test_mode)
|
||||||
|
|
||||||
|
write_timestamp(results_dir, "created")
|
||||||
log.info("Adding %s (%s %s) to compose queue", build_id, recipe["name"], compose_type)
|
log.info("Adding %s (%s %s) to compose queue", build_id, recipe["name"], compose_type)
|
||||||
os.symlink(results_dir, joinpaths(lib_dir, "queue/new/", build_id))
|
os.symlink(results_dir, joinpaths(lib_dir, "queue/new/", build_id))
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import time
|
|||||||
|
|
||||||
from pylorax.api.compose import move_compose_results
|
from pylorax.api.compose import move_compose_results
|
||||||
from pylorax.api.recipes import recipe_from_file
|
from pylorax.api.recipes import recipe_from_file
|
||||||
from pylorax.api.timestamp import timestamp_dict
|
from pylorax.api.timestamp import write_timestamp, timestamp_dict
|
||||||
from pylorax.base import DataHolder
|
from pylorax.base import DataHolder
|
||||||
from pylorax.creator import run_creator
|
from pylorax.creator import run_creator
|
||||||
from pylorax.sysutils import joinpaths
|
from pylorax.sysutils import joinpaths
|
||||||
@ -107,6 +107,7 @@ def monitor(cfg):
|
|||||||
make_compose(cfg, os.path.realpath(dst))
|
make_compose(cfg, os.path.realpath(dst))
|
||||||
log.info("Finished building %s, results are in %s", dst, os.path.realpath(dst))
|
log.info("Finished building %s, results are in %s", dst, os.path.realpath(dst))
|
||||||
open(joinpaths(dst, "STATUS"), "w").write("FINISHED\n")
|
open(joinpaths(dst, "STATUS"), "w").write("FINISHED\n")
|
||||||
|
write_timestamp(dst, "finished")
|
||||||
except Exception:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
log.error("traceback: %s", traceback.format_exc())
|
log.error("traceback: %s", traceback.format_exc())
|
||||||
@ -114,6 +115,7 @@ def monitor(cfg):
|
|||||||
# TODO - Write the error message to an ERROR-LOG file to include with the status
|
# TODO - Write the error message to an ERROR-LOG file to include with the status
|
||||||
# log.error("Error running compose: %s", e)
|
# log.error("Error running compose: %s", e)
|
||||||
open(joinpaths(dst, "STATUS"), "w").write("FAILED\n")
|
open(joinpaths(dst, "STATUS"), "w").write("FAILED\n")
|
||||||
|
write_timestamp(dst, "finished")
|
||||||
|
|
||||||
os.unlink(dst)
|
os.unlink(dst)
|
||||||
|
|
||||||
@ -191,6 +193,7 @@ def make_compose(cfg, results_dir):
|
|||||||
log.debug("cfg = %s", install_cfg)
|
log.debug("cfg = %s", install_cfg)
|
||||||
try:
|
try:
|
||||||
test_path = joinpaths(results_dir, "TEST")
|
test_path = joinpaths(results_dir, "TEST")
|
||||||
|
write_timestamp(results_dir, "started")
|
||||||
if os.path.exists(test_path):
|
if os.path.exists(test_path):
|
||||||
# Pretend to run the compose
|
# Pretend to run the compose
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
Loading…
Reference in New Issue
Block a user