From 54b3b210b07be770f9dc257078d38f78a79e4c1c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 5 Aug 2024 14:11:04 +0200 Subject: [PATCH 001/185] Update test framework - Refactor code - Rename variables - Improve exception handling - Add progress bar - Use f-strings where possible for readability - Improve documentation --- .gitignore | 1 + tools/check.py | 501 +++++++++++++++++++---------------------- tools/maintenance.py | 61 +++-- tools/parse.py | 167 +++++++------- tools/report.py | 64 +++--- tools/requirements.txt | 2 + 6 files changed, 381 insertions(+), 415 deletions(-) diff --git a/.gitignore b/.gitignore index 8f8cfa8d6c..9960fdc446 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ resources/ node_modules/ package-lock.json .hugo_build.lock +.vscode # macOS files *.DS_Store diff --git a/tools/check.py b/tools/check.py index 0b61598ab9..dcc88ba081 100644 --- a/tools/check.py +++ b/tools/check.py @@ -4,298 +4,271 @@ import os import subprocess import json -import yaml from junit_xml import TestSuite, TestCase +import alive_progress + +""" +Checks a dictionary for a given key. Helper function to avoid runtime errors. +""" +def dictionary_lookup(dictionary, key): + try: + # Try that the value exists, and that it is not None + value = dictionary[key] + assert value + return True + except Exception: + raise KeyError(f"\"{key}\" was not found in dictionary.") + +""" +Initializes a Docker container and runs a few commands to set it up. + + - Install dependencies + - Set up user permissions + - Remove the default .bashrc on Ubuntu (since it returns when not interactive) + - Allow write permissions on shared folder + +If the passed image is not supported, an IOError is thrown. +""" +def init_container(i_img, img): + # Launch + container_name = f"test_{i_img}" + logging.info(f"Initializing {container_name} -> {img}") + init_docker_cmd = [f"docker run --rm -t -d -v $PWD/shared:/shared --name test_{i_img} {img}"] + logging.debug(init_docker_cmd) + subprocess.run(init_docker_cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) + + package_manager = "" + user = "" + if img.startswith(("ubuntu", "mongo", "arm-tools")): + package_manager = "apt" + user = "sudo" + elif "fedora" in img: + package_manager = "yum" + user = "wheel" + else: + pass + #raise IOError(f"Image {img} not supported") + + docker_cmd = [f"docker exec test_{i_img} {package_manager} update"] + logging.debug(docker_cmd) + subprocess.run(docker_cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) + + if "arm-tools" in img: + # These images already have a 'ubuntu' user account set up + pass + + docker_cmd = [ + f"docker exec {container_name} {package_manager} install -y sudo wget curl git", + f"docker exec {container_name} useradd user -m -G {user}", + f"docker exec {container_name} bash -c \"cat << EOF > /etc/sudoers.d/user\n user ALL=(ALL) NOPASSWD:ALL\nEOF\"", + f"docker exec {container_name} rm /home/user/.bashrc", + f"docker exec {container_name} chmod ugo+rw /shared" + ] + for cmd in docker_cmd: + logging.debug(cmd) + subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - -''' -Parse header and patch file with test results -''' -def patch(article, results, lk): - with open(article, mode='r') as f: - content = f.read() - f.close() - header = [] - - for i in content: - start = content.find("---") + 3 - end = content.find("---", start) - - if end == start-3: - # No header - logging.debug("No header found in {}".format(article)) - return - else: - header = content[start:end] - markdown = content[end+3:] - data = yaml.safe_load(header, ) - - # Update status or create section - arr = [] - - # Check if this is a learning path - if isinstance(results, list) and data.get("test_images"): - for res in data["test_images"]: - failed = False - for el in (results): - if el[res] != 0: - logging.debug("Status on {}: FAILED".format(res)) - arr.append("failed") - failed = True - break - - if not failed: - logging.debug("Status on {}: passed".format(res)) - arr.append("passed") - elif data.get("test_images"): - for res in data["test_images"]: - if results[res] != 0: - logging.debug("Status on {}: FAILED".format(res)) - arr.append("failed") - else: - logging.debug("Status on {}: passed".format(res)) - arr.append("passed") - - data["test_status"] = arr - - data["test_link"] = lk - - # update markdown files with test results - with open(article, mode='w') as f: - f.write("---\n") - yaml.dump(data, f) - f.write("---") - f.close() - - # write the rest of the content - with open(article, mode='a') as f: - for i in markdown: - f.write(i) - f.close() - - -''' -Read json file and run commands in Docker -''' -def check(json_file, start, stop): + return container_name + +""" +Checks the test for a number of commands and write it to the test command file. +""" +def write_commands_to_file(test_cmd_filename, test): + # Write series of commands in this file + cmd = "" + f = open(test_cmd_filename, "w") + + # Check if: + # - A file needs to be sourced + # - Working directory is specified + # - An environment variable is specified + cmd_args = { + "env_source":"source", + "cwd":"cwd", + "env":"export" + } + for cmd_arg in cmd_args.keys(): + if cmd_arg in test: + # Retrieve the command as string + cmd_arg_test = test[cmd_arg] if isinstance(test[cmd_arg], str) else test[cmd_arg][0] + cmd = cmd_args[cmd_arg] + cmd_arg_test + write_cmd_to_file(f, test_cmd_filename, cmd) + + # Check if commands need to be run before the test + if "pre_cmd" in test: + pre_cmd = test["pre_cmd"] + cmd = pre_cmd + write_cmd_to_file(f, test_cmd_filename, cmd) + + # Check if the test has multiple lines + if test.get("ncmd"): + for cmd_line in range(0, test["ncmd"]): + if "expected" in test.keys(): + # Do not run output commands + if cmd_line in test["expected"]: + continue + cmd = test[f"{cmd_line}"] + write_cmd_to_file(f, test_cmd_filename, cmd) + + f.close() + return cmd + +""" +Write a command to a file and log it for debugging. +""" +def write_cmd_to_file(f, test_cmd_filename, cmd): + logging.debug(f"Command argument written to {test_cmd_filename}: {cmd}") + f.write(f"{cmd}\n") + +""" +Parse JSON file with commands from the Markdown article, +run commands in Docker and log the result in the console. +""" +def check(json_file, start, stop, md_article): with open(json_file) as jf: data = json.load(jf) # Start instances for all images - if start and data.get("image"): - for i, img in enumerate(data["image"]): - # Launch - logging.info("Container instance test_{} is {}".format(i, img)) - cmd = ["docker run --rm -t -d -v $PWD/shared:/shared --name test_{} {}".format(i, img)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - - # Create user and configure - if "arm-tools" in img: - # These images already have a 'ubunutu' user account set up. - cmd = ["docker exec test_{} apt update".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - elif "ubuntu" in img or "mongo" in img: - cmd = ["docker exec test_{} apt update".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - cmd = ["docker exec test_{} apt install -y sudo wget curl git".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - cmd = ["docker exec test_{} useradd user -m -G sudo".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - cmd = ["docker exec test_{} bash -c \"cat << EOF > /etc/sudoers.d/user\n user ALL=(ALL) NOPASSWD:ALL\nEOF\"".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - # The default .bashrc on Ubuntu returns when not interactive so removing it - cmd = ["docker exec test_{} rm /home/user/.bashrc".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - # Allow write permissions on shared folder - cmd = ["docker exec test_{} chmod ugo+rw /shared".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - elif "fedora" in img: - cmd = ["docker exec test_{} yum update".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - cmd = ["docker exec test_{} yum install -y sudo wget curl git".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - cmd = ["docker exec test_{} useradd user -m -G wheel".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - cmd = ["docker exec test_{} bash -c \"cat << EOF > /etc/sudoers.d/user\n user ALL=(ALL) NOPASSWD:ALL\nEOF\"".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - # Allow write permissions on shared folder - cmd = ["docker exec test_{} chmod ugo+rw /shared".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - - logging.info("Container(s) initialization completed") + dictionary_lookup(data, "test_images") + test_images = data["test_images"] + if start: + for i_img, img in enumerate(test_images): + container_name = init_container(i_img=i_img, img=img) + logging.info(f"{container_name} initialized") else: - logging.debug("Skip container(s) launch") - - if data.get("image"): - # Create 1 test suite for each image - test_cases= [[] for img in data["image"]] - # Create array to store test result - results = {img:0 for img in data["image"]} - else: - test_cases = [] - results = {} - - # Check if there are tests - if not "ntests" in data.keys(): + logging.debug("Parameter start is false, skipping container(s) initialization") + + # Create one test suite for each image + test_cases= [[] for img in test_images] + # Create array to store test result + results = {img:0 for img in test_images} + + # Check if there are tests / code blocks + try: + dictionary_lookup(data, "ntests") + except KeyError as err: + logging.error(err) + logging.info(f"No tests were parsed from {md_article}, skipping") return results - # Run bash commands - print(data["ntests"]) - for i in range(0, data["ntests"]): - if not data.get("{}".format(i)): - continue - print(i) - t = data["{}".format(i)] - print(t) - - # Check if file name is specified - if "file_name" in t: - fn = t["file_name"] - else: - fn = ".tmpcmd" - - # Write series of commands in this file - c = "" - f = open(fn, "w") - # Check if a file needs to be sourced - if "env_source" in t: - env_source = t["env_source"] - c = "source " + env_source - logging.debug("Copying command to file to file {}: {}".format(fn, c)) - f.write("{}\n".format(c)) - # Check if env var are specified - if "env" in t: - env = t["env"] - for el in env: - c = "export " + el - logging.debug("Copying command to file to file {}: {}".format(fn, c)) - f.write("{}\n".format(c)) - # Check if commands need to be run beforehand - if "pre_cmd" in t: - pre_cmd = t["pre_cmd"] - c = pre_cmd - logging.debug("Copying command to file to file {}: {}".format(fn, c)) - f.write("{}\n".format(c)) - # Check if cwd is specified - if "cwd" in t: - c = "cd " + t["cwd"] - logging.debug("Copying command to file {}: {}".format(fn, c)) - f.write("{}\n".format(c)) - if t.get("ncmd"): - for j in range(0, t["ncmd"]): - if "expected" in t.keys(): - # Do not run output commands - if j == (int(eval(t["expected"]))-1): - break - c = t["{}".format(j)] - logging.debug("Copying command to file {}: {}".format(fn, c)) - f.write("{}\n".format(c)) - f.close() - - # Check if a target is specified - if "target" in t: - # get element index of instance - idx = data["image"].index(t["target"]) - inst = range(idx, idx+1) - else: - inst = range(0, len(data["image"])) - - username = "ubuntu" if "arm-tools" in data["image"][0] else "user" - for k in inst: - # Copy over the file with commands - cmd = ["docker cp {} test_{}:/home/{}/".format(fn, k, username)] - subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - logging.debug(cmd) - - # Check type - if t["type"] == "fvp": - # Only allow single line commands - if t["fvp_name"] == "FVP_Corstone_SSE-300_Ethos-U65": - cmd = t["0"].replace("FVP_Corstone_SSE-300_Ethos-U65", "docker run --rm -ti -v $PWD/shared:/shared -w {} -e ETHOS_U65=1 -e NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp".format(t["cwd"])) + # Run code blocks + test_images = data["test_images"] + for n_image, test_image in zip(range(0, len(test_images)), test_images): + logging.info(f"--- Testing on {test_image} ---") + with alive_progress.alive_bar(data["ntests"], title=test_image, stats=False) as bar: + for n_test in range(0, data["ntests"]): + dictionary_lookup(data, f"{n_test}") + test = data[f"{n_test}"] + + test_target = test.get("target") + if test_target and test_target != test_image: + pass + elif not test_target: + pass + elif test_target: + pass else: - cmd = t["0"].replace("FVP_Corstone_SSE-300_Ethos-U55", "docker run --rm -ti -v $PWD/shared:/shared -w {} -e NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp".format(t["cwd"])) - elif t["type"] == "bash": - cmd = ["docker exec -u {} -w /home/{} test_{} bash {}".format(username, username, k, fn)] - else: - logging.debug("Omitting type: {}".format(t["type"])) - cmd = [] + bar(skipped=True) + continue - if cmd != []: - logging.debug(cmd) - p = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if "file_name" in test: + test_cmd_filename = test["file_name"] + else: + test_cmd_filename = ".tmpcmd" + + cmd = write_commands_to_file(test_cmd_filename, test) + + username = "ubuntu" if "arm-tools" in test_images[0] else "user" + + # Copy over the file with commands + docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] + subprocess.run(docker_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + logging.debug(docker_cmd) + + # Check type + if test["type"] == "fvp": + ethos_u65 = "" + fvp_name = test["fvp_name"] + if fvp_name == "FVP_Corstone_SSE-300_Ethos-U65": + ethos_u65 = "ETHOS_U65=1 -e" + # Only allow single line commands + docker_cmd = test["0"].replace(f"{fvp_name}", + f"docker run --rm -ti -v $PWD/shared:/shared -w {test["cwd"]} -e \ + {ethos_u65} NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp" + ) + elif test["type"] == "bash": + docker_cmd = [f"docker exec -u {username} -w /home/{username} test_{n_image} bash {test_cmd_filename}"] + else: + logging.debug(f"Type '{test["type"]}' not supported for testing. Contact the maintainers if you think this is a mistake.") + bar(skipped=True) + continue - # create test case - test_cases[k].append(TestCase("{}_{}_test-{}".format(json_file.replace("_cmd.json",""), data["image"][k], i), c, 0, p.stdout.rstrip().decode("utf-8"), '')) + logging.debug(docker_cmd) + process = subprocess.run(docker_cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE) + process_output = process.stdout.rstrip().decode("utf-8") - ret_code = 0 - if "ret_code" in t.keys(): - ret_code = int(t["ret_code"]) + # Create test case + test_case = TestCase(f"{json_file.replace("_cmd.json","")}_{test_images[n_image]}_test-{n_image}", + cmd, 0, process_output, '') + test_cases[n_image].append(test_case) + test_ret_code = int(test["ret_code"]) if test.get("ret_code") else 0 + test_passed = False # if success - if p.returncode == ret_code: + if process.returncode == test_ret_code: # check with expected result if any - if "expected" in t.keys(): - t_expected = t.get("{}".format(int(eval(t["expected"]))-1)) - if t_expected: - exp = t[t_expected] - # strip out '\n' and decode byte to string - if exp == p.stdout.rstrip().decode("utf-8"): - msg = "Test passed" + if "expected" in test.keys(): + for line in test["expected"]: + exp = test[str(line)] + if exp == process_output: + test_passed = True + msg = "PASSED" else: - msg = "ERROR (unexpected output. Expected {} but got {})".format(exp, p.stdout.rstrip().decode("utf-8")) - test_cases[k][-1].add_failure_info(msg) - results[data["image"][k]] = results[data["image"][k]]+1 + msg = f"ERROR. Expected {exp}. Run with --debug to see output." + test_cases[n_image][-1].add_failure_info(msg) + results[test_images[n_image]] = results[test_images[n_image]]+1 else: - msg = "Test passed" + test_passed = True + msg = "PASSED" else: - msg = "ERROR (command failed. Return code is {} but expected {})".format(p.returncode, ret_code) - test_cases[k][-1].add_failure_info(msg) - results[data["image"][k]] = results[data["image"][k]]+1 - - logging.debug("Test {}: {}".format(i, msg)) - logging.info("{:.0f}% of all tests completed on instance test_{}".format(i/data["ntests"]*100, k)) - - # Remove file with list of commands - os.remove(fn) + msg = f"ERROR. Expected return code {test_ret_code} but got {process.returncode}" + test_cases[n_image][-1].add_failure_info(msg) + results[test_images[n_image]] = results[test_images[n_image]]+1 + bar() + logging.info(f"{cmd}\n{msg}") + if not test_passed: + logging.debug(f"{process_output}") + else: + logging.debug(f"{process_output}") + # Remove file with list of commands + os.remove(test_cmd_filename) - logging.info("100% of all tests completed") + result = "failed" if results[test_images[n_image]] else "passed" + logging.info(f"Tests {result} on {test_image}") # add to test suite and write junit results ts = [] - for k in range(0, len(data["image"])): - ts.append(TestSuite("{} {}".format(json_file,data["image"][k]), test_cases[k])) + for n_instance in range(0, len(test_images)): + ts.append(TestSuite(f"{json_file} {test_images[n_instance]}", test_cases[n_instance])) + json_file_name = json_file.replace(".json", ".xml") - with open(json_file.replace(".json", ".xml"), mode='w') as lFile: + with open(json_file_name, mode='w') as lFile: TestSuite.to_file(lFile, ts, prettyprint=True) lFile.close() - logging.info("Results written in {}".format(json_file.replace(".json", ".xml"))) # Stop instance if stop: - logging.info("Terminating container(s)...") - for i, img in enumerate(data["image"]): - cmd = ["docker stop test_{}".format(i)] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) - - logging.info("Removing shared directory...") - cmd = ["sudo rm -rf shared"] - logging.debug(cmd) - subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) + logging.debug("Terminating container(s)") + for i_img, img in enumerate(test_images): + cleanup_cmd = [f"docker stop test_{i_img}"] + logging.debug(cleanup_cmd) + subprocess.run(cleanup_cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) + + logging.debug("Removing shared directory") + cleanup_cmd = ["rm -rf shared"] + logging.debug(cleanup_cmd) + subprocess.run(cleanup_cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) else: - logging.debug("Skip container(s) termination...") + logging.debug("Parameter stop is false, skipping container(s) termination") - return results + return results \ No newline at end of file diff --git a/tools/maintenance.py b/tools/maintenance.py index cd76cc931d..2065d19c37 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -16,9 +16,9 @@ level = { 10: "DEBUG", 20: "INFO", 30: "WARNING", 40: "ERROR" } -''' +""" Test Learning Path -''' +""" def check_lp(lp_path, link, debug): if not os.path.isdir(lp_path): lp_path = os.path.dirname(lp_path) @@ -27,8 +27,8 @@ def check_lp(lp_path, link, debug): if os.path.exists(lp_path+"/_index.md"): # check _index.md for maintenance options - idx_header = parse.header(lp_path+"/_index.md") - if idx_header["maintain"]: + idx_header = parse.header(lp_path+"/_index.md") + if idx_header["test_maintenance"]: # Parse all articles in folder to check them for k in os.listdir(lp_path): # Don't parse _index, _next-steps or _review @@ -37,17 +37,18 @@ def check_lp(lp_path, link, debug): logging.info("Parsing " + _k) cmd = parse.parse(_k) # Generate _cmd.json file with instructions - parse.save(_k, cmd, idx_header["maintain"], idx_header["img"]) - - + parse.save_commands_to_json(_k, cmd, idx_header["test_maintenance"], idx_header["test_images"]) + + logging.info("Checking Learning Path " + lp_path) # Look for _cmd.json l = [i for i in os.listdir(lp_path) if i.endswith("_cmd.json")] # Build dict with weight value for each article - d = { i: parse.header(lp_path + "/" + i.replace("_cmd.json",""))["wght"] for i in l } + article_per_weight = { i: parse.header(lp_path + "/" + i.replace("_cmd.json",""))["weight"] for i in l } # Sort dict by value res = [] - for idx, i in enumerate(sorted(d.items(), key=lambda item: item[1])): + # sort LP by weight value to have it run sequentially + for idx, i in enumerate(sorted(article_per_weight.items(), key=lambda item: item[1])): logging.info("Checking " + i[0].replace("_cmd.json","")) # We want all the articles from the learning path to run in the same container # Launch the instance at the beginning, and terminate it at the end @@ -55,26 +56,23 @@ def check_lp(lp_path, link, debug): terminate = True if i[1] != -1 and idx != 0: launch = False - if i[1] != -1 and idx != len(d.keys())-1: + if i[1] != -1 and idx != len(article_per_weight.keys())-1: terminate = False - res.append(check.check(lp_path + "/" + i[0], start=launch, stop=terminate)) - - logging.info("Patching " + lp_path + "/_index.md with test results") - check.patch(lp_path + "/_index.md", res, link) + res.append(check.check(lp_path + "/" + i[0], start=launch, stop=terminate, md_article=lp_path)) if not debug: for i in os.listdir(lp_path): if i.endswith("_cmd.json"): os.remove(lp_path+"/"+i) else: - logging.warning("Learning Path {} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.".format(lp_path)) + logging.warning(f"Learning Path {lp_path} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") else: logging.warning("No _index.md found in Learning Path") -''' +""" Main function -''' +""" def main(): global verbosity, level @@ -103,6 +101,7 @@ def main(): if args.instructions: # check if article is a csv file corresponding to a file list if args.instructions.endswith(".csv"): + # TODO idea: separate parsing of CSV into list, run in same way as a single one passed logging.info("Parsing CSV " + args.instructions) with open(args.instructions) as f: next(f) # skip header @@ -114,17 +113,15 @@ def main(): elif fn.endswith(".md"): logging.info("Parsing " + fn) # check if maintenance if enabled - if parse.header(fn)["maintain"]: + if parse.header(fn)["test_maintenance"]: cmd = parse.parse(fn) - parse.save(fn, cmd) + parse.save_commands_to_json(fn, cmd) logging.info("Checking " + fn) - res = check.check(fn+"_cmd.json", start=True, stop=True) - logging.info("Patching " + fn + " with test results") - check.patch(fn, res, args.link) + res = check.check(fn+"_cmd.json", start=True, stop=True, md_article=fn) if not args.debug: os.remove(fn+"_cmd.json") else: - logging.warning("{} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.".format(fn)) + logging.warning(f"{fn} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") else: logging.error("Unknown type " + fn) elif args.instructions.endswith(".md"): @@ -134,24 +131,22 @@ def main(): else: logging.info("Parsing " + args.instructions) # check if maintenance if enabled - if parse.header(args.instructions)["maintain"]: + if parse.header(args.instructions)["test_maintenance"]: cmd = parse.parse(args.instructions) - parse.save(args.instructions, cmd) - res = check.check(args.instructions+"_cmd.json", start=True, stop=True) - logging.info("Patching " + args.instructions + " with test results") - check.patch(args.instructions, res, args.link) + parse.save_commands_to_json(args.instructions, cmd) + res = check.check(args.instructions+"_cmd.json", start=True, stop=True, md_article=args.instructions) if not args.debug: os.remove(args.instructions+"_cmd.json") else: - logging.warning("{} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.".format(args.instructions)) + logging.warning(f"{args.instructions} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") elif os.path.isdir(args.instructions) and "/learning-paths/" in os.path.abspath(args.instructions): check_lp(args.instructions, args.link, args.debug) else: logging.error("-i/--instructions expects a .md file, a CSV with a list of files or a Learning Path directory") elif args.spelling: - logging.info("Checking spelling of {}".format(args.spelling)) + logging.info(f"Checking spelling of {args.spelling}") output = parse.spelling(args.spelling) - logging.info("Highlighing mispelling in {}".format(args.spelling)) + logging.info(f"Highlighing mispelling in {args.spelling}") f = open(args.spelling, "w") f.write(output) f.close() @@ -159,11 +154,11 @@ def main(): logging.info("Filter-check") filter_checker.checker(args.type, args.patch) elif args.query: - logging.info("Querying data and generating stats...") + logging.info("Querying data and generating stats") report.stats() logging.info("Stats updated in content/stats/data.json") elif args.report: - logging.info("Creating report of articles older than {} days".format(args.report)) + logging.info(f"Creating report of articles older than {args.report} days") report.report(args.report) diff --git a/tools/parse.py b/tools/parse.py index 02d9459ad9..5d6adeacb4 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -9,30 +9,29 @@ from inclusivewriting.suggestions import detect_and_get_suggestions from spellchecker import SpellChecker - -''' +""" Parse commands in markdown article and return list of commands -''' +""" def parse(article): with open(article) as file: content = file.read() file.close() - cmd = [] + cmds_list = [] for i in content: start = content.find("```") + 3 end = content.find("```", start) if start == -1 or end == -1: # No code section left - return cmd + return cmds_list else: - cmd.append(content[start:end]) + cmds_list.append(content[start:end]) content = content[end+3:] -''' +""" Parse file for spelling mistakes in text -''' +""" def spelling(article): language = "en" @@ -75,7 +74,7 @@ def spelling(article): for word in txt_list: # get rid of punctuation and make lower case word_clean = word.translate(str.maketrans('', '', string.punctuation.replace("-",""))) - if not word_clean == '': + if not word_clean == '': word_list.append(word_clean) new_text = txt @@ -91,7 +90,7 @@ def spelling(article): replacement_list = replacement_list + "\"" new_text, nsub = re.subn(" {} ".format(word), " {{{{< highlight green {} {} >}}}} ".format(word,replacement_list), new_text) icount += nsub - + for u in unknown_list: new_text, nsub = re.subn(" {} ".format(u), " {{{{< highlight yellow {} {} >}}}} ".format(u,spell.correction(u)), new_text) rcount += nsub @@ -102,20 +101,20 @@ def spelling(article): content = content[end+3:] # No code section left - logging.info("{} inclusive language issue(s) found.".format(icount)) - logging.info("{} spelling mistake(s) found.".format(rcount)) + logging.info(f"{icount} inclusive language issue(s) found.") + logging.info(f"{rcount} spelling mistake(s) found.") return output -''' +""" Parse header to check file or not Returns dict with the following elements: test_maintenance: bool value to check the article test_images: list of targets supported weight: int value with weight of article when in a learning path -''' +""" def header(article): - dict = {"maintain": False, "img": None, "weight": -1} + dict = {"test_maintenance": False, "test_images": None, "weight": -1} with open(article) as file: content = file.read() file.close() @@ -125,107 +124,103 @@ def header(article): end = content.find("---", start) if end == start-3: # No header - logging.debug("No header found in {}".format(article)) + logging.debug(f"No header found in {article}") return dict else: header = content[start:end] data = yaml.safe_load(header, ) if "test_maintenance" in data.keys(): - dict.update(maintain=data["test_maintenance"]) + dict.update(test_maintenance=data["test_maintenance"]) if "test_images" in data.keys(): - dict.update(img= data["test_images"]) + dict.update(test_images=data["test_images"]) if "weight" in data.keys(): - dict.update(wght=data["weight"]) - + dict.update(weight=data["weight"]) + return dict +""" +Extract the argument value and return in a dict with the argument key. +""" +def get_arg_to_key_dict(cmd, key): + value = cmd[0].split(f"{key}\"")[1].split("\"")[0] + return { key : value } + +""" +Parse all code blocks in a Markdown article and write to a JSON file. +""" +def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): -''' -Save list of command in json file -''' -def save(article, cmd, learningpath=False, img=None): - # Parse file header - hdr = header(article) + article_header = header(md_article) - if not hdr["maintain"] and not learningpath: - logging.info("File {} settings don't enable parsing.".format(article)) + if not article_header["test_maintenance"] and not learningpath: + logging.info(f"File {md_article} settings doesn't enable parsing") return if not img: - img = hdr["img"] + img = article_header["test_images"] - content = { "image": img, "weight": hdr["weight"]} + content = {"test_images": img, "weight": article_header["weight"]} logging.debug(content) - for i_idx,i in enumerate(cmd): - l = list(filter(None, i.split("\n"))) - # if fvp type, check for arguments - if not l: + for cmd_idx, cmd_str in enumerate(cmds_list): + cmd_lines = list(filter(None, cmd_str.split("\n"))) + if not cmd_lines: continue - elif "fvp" in l[0]: - content[i_idx] = {"type": "fvp"} + + cmd_lines_header = cmd_lines[0] + # if fvp type, check for arguments + if "fvp" in cmd_lines_header: + content[cmd_idx] = {"type": "fvp"} # check if current directory is specified - if "cwd" in l[0]: - cwd = l[0].split("cwd=\"")[1].split("\"")[0] - content[i_idx].update({"cwd": cwd }) - if "fvp_name" in l[0]: - model = l[0].split("fvp_name=\"")[1].split("\"")[0] - content[i_idx].update({"fvp_name": model }) + if "cwd" in cmd_lines_header: + cwd = cmd_lines_header.split("cwd=\"")[1].split("\"")[0] + content[cmd_idx].update({"cwd": cwd}) + if "fvp_name" in cmd_lines_header: + model = cmd_lines_header.split("fvp_name=\"")[1].split("\"")[0] + content[cmd_idx].update({"fvp_name": model }) else: - content[i_idx].update({"fvp_name": "FVP_Corstone_SSE-300_Ethos-U55" }) + content[cmd_idx].update({"fvp_name": "FVP_Corstone_SSE-300_Ethos-U55" }) # if bash type, check for arguments - elif "bash" in l[0]: - content[i_idx] = {"type": "bash"} - # check if return code is specified - if "ret_code" in l[0]: - ret = l[0].split("ret_code=\"")[1].split("\"")[0] - content[i_idx].update({"ret_code": ret }) - else: - content[i_idx].update({"ret_code": "0" }) - # check if a file needs to be sourced - if "env_source" in l[0]: - env = l[0].split("env_source=\"")[1].split("\"")[0] - content[i_idx].update({"env_source": env }) - # check if env var are specified - if "env=" in l[0]: - env = l[0].split("env=\"")[1].split("\"")[0] - env = env.split(";") - content[i_idx].update({"env": env }) - # check if commands need to be run beforehand - if "pre_cmd" in l[0]: - env = l[0].split("pre_cmd=\"")[1].split("\"")[0] - content[i_idx].update({"pre_cmd": env }) - # check if current directory is specified - if "cwd" in l[0]: - cwd = l[0].split("cwd=\"")[1].split("\"")[0] - content[i_idx].update({"cwd": cwd }) - # check target - if "target" in l[0]: - tgt = l[0].split("target=\"")[1].split("\"")[0] - content[i_idx].update({"target": tgt }) - # check if any expected result - if "|" in l[0]: - expected_result = l[0].split("| ")[1].split("\"")[0] - content[i_idx].update({"expected": expected_result }) + elif "bash" in cmd_lines_header: + arg_list = ["ret_code", "env_source", "env=", "pre_cmd", "cwd", "target"] + content[cmd_idx] = {"type": "bash"} + for arg in arg_list: + if arg in cmd_str: + arg_str = cmd_str.split(arg)[1].split("\"")[0] + content[cmd_idx].update({arg:arg_str}) + if "|" in cmd_str: + expected_result = cmd_str.split("| ")[1].split("\"")[0].split("-") + if len(expected_result) > 1: + expected_lines = list(range(*[int(x)-1 for x in expected_result])) + elif len(expected_result) == 1 and expected_result[0]: + expected_lines = [int(expected_result[0])-1] + else: + raise IOError( + """The expected output line(s) should be specified as one of two options: + A single number: | 2 + A range: | 2-10 + The code block is indexing starts at 1""") + content[cmd_idx].update({"expected": expected_lines }) # for other types, we're assuming source code # check if a file name is specified else: - content[i_idx] = {"type": l[0]} + content[cmd_idx] = {"type": cmd_lines_header} # check file name - if "file_name" in l[0]: - fn = l[0].split("file_name=\"")[1].split("\"")[0] - content[i_idx].update({"file_name": fn }) + if "file_name" in cmd_lines_header: + fn = cmd_lines_header.split("file_name=\"")[1].split("\"")[0] + content[cmd_idx].update({"file_name": fn }) - for j_idx,j in enumerate(l[1:]): - content[i_idx].update({j_idx: j}) - content[i_idx].update({ "ncmd": j_idx+1 }) - content.update({ "ntests": i_idx+1 }) + # Parse all the lines in the code block + for cmd_line_idx, cmd_line in enumerate(cmd_lines[1:]): + content[cmd_idx].update({cmd_line_idx: cmd_line}) + content[cmd_idx].update({ "ncmd": cmd_line_idx+1 }) + content.update({ "ntests": cmd_idx+1 }) - logging.debug(content[i_idx]) + logging.debug(content[cmd_idx]) - fn = article + "_cmd.json" + fn = md_article + "_cmd.json" logging.debug("Saving commands to " + fn) with open(fn, 'w') as f: diff --git a/tools/report.py b/tools/report.py index 2052b91b60..38a06982fb 100644 --- a/tools/report.py +++ b/tools/report.py @@ -20,13 +20,13 @@ "content/learning-paths/servers-and-cloud-computing"] -''' -Recursive content search in d. -Returns: +""" +Recursive content search in d. +Returns: - list of articles older than period in d - count of articles found in d - list of primary authors in d -''' +""" def content_parser(d, period): count = 0 art_list = {} @@ -39,14 +39,14 @@ def content_parser(d, period): if "learning-paths" in d: item = "_index.md" - logging.debug("Checking {}...".format(d+"/"+item)) + logging.debug(f"Checking {d+"/"+item}") date = subprocess.run(["git", "log", "-1" ,"--format=%cs", d +"/" + item], stdout=subprocess.PIPE) # strip out '\n' and decode byte to string date = date.stdout.rstrip().decode("utf-8") logging.debug("Last updated on: " + date) author = "None" - for l in open(d +"/" + item): + for l in open(d +"/" + item): if re.search("author_primary", l): # split and strip out '\n' author = l.split(": ")[1].rstrip() @@ -60,9 +60,9 @@ def content_parser(d, period): # check if article is older than the period if date < datetime.now() - timedelta(days = period): if item == "_index.md": - art_list[d + "/"] = "{} days ago".format((datetime.now() - date).days) + art_list[d + "/"] = f"{(datetime.now() - date).days} days ago" else: - art_list[d + "/" + item] = "{} days ago".format((datetime.now() - date).days) + art_list[d + "/" + item] = f"{(datetime.now() - date).days} days ago" if "learning-paths" in d: # no need to iterate further @@ -80,14 +80,14 @@ def content_parser(d, period): return [art_list, count, auth_list] -''' +""" Initialize Plotly data structure for stats -1 graph on the left with data for install tool guides +1 graph on the left with data for install tool guides 1 graph on the right with data for learning paths Input: title for the graph -''' +""" def init_graph(title): - data = { + data = { "data": [ { "x": [], @@ -139,29 +139,29 @@ def init_graph(title): "xaxis": "x2" } ], - "layout": + "layout": { - "title": title, - "xaxis": + "title": title, + "xaxis": { "tickangle": -45, "domain": [0, 0.45], "anchor": "x1" - }, - "xaxis2": + }, + "xaxis2": { "tickangle": -45, "domain": [0.55, 1], "anchor": "x2" - }, - "barmode": "stack", + }, + "barmode": "stack", "paper_bgcolor": "rgba(0,0,0,0)", "plot_bgcolor": "rgba(0,0,0,0)", - "font": + "font": { "color": "rgba(130,130,130,1)" }, - "legend": + "legend": { "bgcolor": "rgba(0,0,0,0)" } @@ -171,9 +171,9 @@ def init_graph(title): return data -''' +""" Generate JSON data for stats page -''' +""" def stats(): global dname @@ -222,12 +222,12 @@ def stats(): contrib_data["data"][d_idx]["y"].append(len(authors)) if "learning-paths" in d: - logging.info("{} Learning Paths found in {} and {} contributor(s).".format(count, d, len(authors))) + logging.info(f"{count} Learning Paths found in {d} and {len(authors)} contributor(s)") total += count else: - logging.info("{} articles found in {} and {} contributor(s).".format(count, d, len(authors))) + logging.info(f"{count} articles found in {d} and {len(authors)} contributor(s)") - logging.info("Total number of Learning Paths is {}.".format(total)) + logging.info(f"Total number of Learning Paths is {total}") fn_lp='content/stats/lp_data.json' fn_contrib='content/stats/contrib_data.json' @@ -240,16 +240,16 @@ def stats(): f_contrib = open(fn_contrib, 'w') # Write results to file json.dump(lp_data, f_lp) - json.dump(contrib_data, f_contrib) + json.dump(contrib_data, f_contrib) # Closing JSON file f_lp.close() f_contrib.close() -''' +""" List pages older than a period in days and save result as CSV Generate JSON file with data -''' +""" def report(period): global dname @@ -265,12 +265,12 @@ def report(period): res, count, authors = content_parser(d, period) result.update(res) if "learning-paths" in d: - logging.info("Found {} Learning Paths in {}. {} of them are outdated.".format(count, d, len(res))) + logging.info(f"Found {count} Learning Paths in {d}. {len(res)} of them are outdated") total += count else: - logging.info("Found {} articles in {}. {} of them are outdated.".format(count, d, len(res))) + logging.info(f"Found {count} articles in {d}. {len(res)} of them are outdated") - logging.info("Total number of Learning Paths is {}.".format(total)) + logging.info(f"Total number of Learning Paths is {total}") fn="outdated_files.csv" fields=["File", "Last updated"] diff --git a/tools/requirements.txt b/tools/requirements.txt index d28433e30f..f1d5233716 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -2,3 +2,5 @@ junit-xml pyyaml inclusivewriting pyspellchecker +better-profanity +setuptools \ No newline at end of file From 04e821f4cc6019be24c0e9462dd003b378d3bd8f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 13 Aug 2024 13:32:37 +0200 Subject: [PATCH 002/185] Merge report.py --- tools/report.py | 103 +++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 45 deletions(-) diff --git a/tools/report.py b/tools/report.py index 38a06982fb..6764a9f800 100644 --- a/tools/report.py +++ b/tools/report.py @@ -1,13 +1,11 @@ #/usr/bin/env python3 -import argparse import logging import os import subprocess import csv import json import re -from pathlib import Path from datetime import datetime, timedelta # List of directories to parse for learning paths @@ -20,57 +18,70 @@ "content/learning-paths/servers-and-cloud-computing"] + + +""" +Returns the date (yyyy-mm-dd) which a file in the given directory was last updated. +If Learning Path, changes in any file in the directory will count. +""" +def get_latest_updated(directory, is_lp, item): + article_path = directory if is_lp else f"{directory}/{item}" + date = subprocess.run(["git", "log", "-1" ,"--format=%cs", str(article_path)], stdout=subprocess.PIPE) + return date + """ -Recursive content search in d. +Recursive content search in a given directory. Returns: -- list of articles older than period in d -- count of articles found in d -- list of primary authors in d +- list of articles older than a given period found +- count of articles found +- list of primary authors found """ -def content_parser(d, period): +def content_parser(directory, period): count = 0 art_list = {} auth_list = [] - l = os.listdir(d) - for i in l: + directory_list = os.listdir(directory) + for i in directory_list: item = i + is_lp = False if item.endswith(".md") and not item.startswith("_"): count = count + 1 - if "learning-paths" in d: + if "learning-paths" in directory: item = "_index.md" + is_lp = True - logging.debug(f"Checking {d+"/"+item}") + logging.debug(f"Checking {directory}/{item}") - date = subprocess.run(["git", "log", "-1" ,"--format=%cs", d +"/" + item], stdout=subprocess.PIPE) + date = get_latest_updated(directory, is_lp, item) # strip out '\n' and decode byte to string date = date.stdout.rstrip().decode("utf-8") - logging.debug("Last updated on: " + date) + logging.debug(f"Last updated: {date}") author = "None" - for l in open(d +"/" + item): - if re.search("author_primary", l): + for directory_list in open(directory +"/" + item): + if re.search("author_primary", directory_list): # split and strip out '\n' - author = l.split(": ")[1].rstrip() - logging.debug("Primary author: " + author) + author = directory_list.split(": ")[1].rstrip() + logging.debug(f"Primary author {author}") if not author in auth_list: auth_list.append(author) - # if empty, this is a temporary file which is not part of the repo - if(date != ""): + # if date is None, this is a temporary file which is not part of the repo + if date: date = datetime.strptime(date, "%Y-%m-%d") # check if article is older than the period if date < datetime.now() - timedelta(days = period): - if item == "_index.md": - art_list[d + "/"] = f"{(datetime.now() - date).days} days ago" + if is_lp: + art_list[directory + "/"] = f"{(datetime.now() - date).days} days ago" else: - art_list[d + "/" + item] = f"{(datetime.now() - date).days} days ago" + art_list[directory + "/" + item] = f"{(datetime.now() - date).days} days ago" - if "learning-paths" in d: + if "learning-paths" in directory: # no need to iterate further break # if this is a folder, let's get down one level deeper - elif os.path.isdir(d + "/" + item): - res, c, a_l = content_parser(d + "/" + item, period) + elif os.path.isdir(directory + "/" + item): + res, c, a_l = content_parser(directory + "/" + item, period) art_list.update(res) count = count + c for a in a_l: @@ -177,6 +188,7 @@ def init_graph(title): def stats(): global dname + # get working directory orig = os.path.abspath(os.getcwd()) # If file exists, load data. Create structure otherwise @@ -229,15 +241,15 @@ def stats(): logging.info(f"Total number of Learning Paths is {total}") - fn_lp='content/stats/lp_data.json' - fn_contrib='content/stats/contrib_data.json' + lp_data_file='content/stats/lp_data.json' + contrib_data_file='content/stats/contrib_data.json' os.chdir(orig) - logging.info("Learning Path data written in " + orig + "/" + fn_lp) - logging.info("Contributors data written in " + orig + "/" + fn_contrib) + logging.info(f"Learning Path data written to {orig}/{lp_data_file}") + logging.info(f"Contributors data written to {orig}/{contrib_data_file}") # Save data in json file - f_lp = open(fn_lp, 'w') - f_contrib = open(fn_contrib, 'w') + f_lp = open(lp_data_file, 'w') + f_contrib = open(contrib_data_file, 'w') # Write results to file json.dump(lp_data, f_lp) json.dump(contrib_data, f_contrib) @@ -253,33 +265,34 @@ def stats(): def report(period): global dname - orig = os.path.abspath(os.getcwd()) - # chdir to the root folder + # get working directory + function_start_directory = os.path.abspath(os.getcwd()) + # change directory to the repository root os.chdir(os.path.dirname(os.path.abspath(__file__)) + "/..") result = {} - total=0 - for d_idx, d in enumerate(dname): - res, count, authors = content_parser(d, period) + + for d_idx, directory in enumerate(dname): + res, count, _ = content_parser(directory, period) result.update(res) - if "learning-paths" in d: - logging.info(f"Found {count} Learning Paths in {d}. {len(res)} of them are outdated") + if "learning-paths" in directory: total += count - else: - logging.info(f"Found {count} articles in {d}. {len(res)} of them are outdated") + + logging.info(f"Found {count} Learning Paths in {directory}. {len(res)} of them are outdated") + logging.info(f"Total number of Learning Paths is {total}") - fn="outdated_files.csv" + outdated_files_csv="outdated_files.csv" fields=["File", "Last updated"] - os.chdir(orig) - logging.info("Results written in " + orig + "/" + fn) + # Moving back to the directory which we started in + os.chdir(function_start_directory) - with open(fn, 'w') as csvfile: + with open(outdated_files_csv, 'w') as csvfile: writer = csv.DictWriter(csvfile, fieldnames = fields) writer.writeheader() for key in result.keys(): csvfile.write("%s, %s\n" % (key, result[key])) - + logging.info(f"Results written to {function_start_directory}/{outdated_files_csv}") \ No newline at end of file From 683cf5769f54d3e77051b29d61c0436e64e6f8b0 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:11:54 +0200 Subject: [PATCH 003/185] Create test-lp.yml --- .github/workflows/test-lp.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/test-lp.yml diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml new file mode 100644 index 0000000000..7daaf7896d --- /dev/null +++ b/.github/workflows/test-lp.yml @@ -0,0 +1,13 @@ +name: Test Learning Path +on: workflow_dispatch +jobs: + Test-Suite: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - name: Check out repository code + uses: actions/checkout@v4 + - name: List files in the repository + run: | + ls ${{ github.workspace }} From e7e369ff7b6d33e65b2c0dc8863c5f5bcb879ede Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 14 Aug 2024 08:49:29 +0200 Subject: [PATCH 004/185] Add test script for GitHub Actions --- .github/workflows/test-lp.yml | 7 +++---- .github/workflows/test_lp.sh | 3 +++ tools/check.py | 22 +++++++++++++--------- tools/requirements.txt | 3 ++- 4 files changed, 21 insertions(+), 14 deletions(-) create mode 100755 .github/workflows/test_lp.sh diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 7daaf7896d..5a9fbf3b40 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,5 +1,5 @@ -name: Test Learning Path -on: workflow_dispatch +name: Test Learning Path +on: push jobs: Test-Suite: runs-on: ubuntu-latest @@ -9,5 +9,4 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 - name: List files in the repository - run: | - ls ${{ github.workspace }} + run: bash ./.github/workflows/test_lp.sh ${{ github.workspace }} diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh new file mode 100755 index 0000000000..2a72b225f1 --- /dev/null +++ b/.github/workflows/test_lp.sh @@ -0,0 +1,3 @@ +echo "HELLO WORLD" +pip install -r $1/tools/requirements.txt +./tools/maintenance.py -i $1/content/install-guides/cmake.md \ No newline at end of file diff --git a/tools/check.py b/tools/check.py index dcc88ba081..00a80805e8 100644 --- a/tools/check.py +++ b/tools/check.py @@ -46,8 +46,7 @@ def init_container(i_img, img): package_manager = "yum" user = "wheel" else: - pass - #raise IOError(f"Image {img} not supported") + raise IOError(f"Image {img} not supported") docker_cmd = [f"docker exec test_{i_img} {package_manager} update"] logging.debug(docker_cmd) @@ -118,7 +117,9 @@ def write_commands_to_file(test_cmd_filename, test): """ def write_cmd_to_file(f, test_cmd_filename, cmd): logging.debug(f"Command argument written to {test_cmd_filename}: {cmd}") - f.write(f"{cmd}\n") + cmd_str = f"{cmd}\n" + f.write(cmd_str) + logging.info(cmd_str) """ Parse JSON file with commands from the Markdown article, @@ -185,21 +186,23 @@ def check(json_file, start, stop, md_article): subprocess.run(docker_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) logging.debug(docker_cmd) + test_type = test["type"] # Check type - if test["type"] == "fvp": + if test_type == "fvp": ethos_u65 = "" fvp_name = test["fvp_name"] if fvp_name == "FVP_Corstone_SSE-300_Ethos-U65": ethos_u65 = "ETHOS_U65=1 -e" + test_cwd = test["cwd"] # Only allow single line commands docker_cmd = test["0"].replace(f"{fvp_name}", - f"docker run --rm -ti -v $PWD/shared:/shared -w {test["cwd"]} -e \ + f"docker run --rm -ti -v $PWD/shared:/shared -w {test_cwd} -e \ {ethos_u65} NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp" ) - elif test["type"] == "bash": + elif test_type == "bash": docker_cmd = [f"docker exec -u {username} -w /home/{username} test_{n_image} bash {test_cmd_filename}"] else: - logging.debug(f"Type '{test["type"]}' not supported for testing. Contact the maintainers if you think this is a mistake.") + logging.debug(f"Type '{test_type}' not supported for testing. Contact the maintainers if you think this is a mistake.") bar(skipped=True) continue @@ -208,7 +211,8 @@ def check(json_file, start, stop, md_article): process_output = process.stdout.rstrip().decode("utf-8") # Create test case - test_case = TestCase(f"{json_file.replace("_cmd.json","")}_{test_images[n_image]}_test-{n_image}", + test_case_name = json_file.replace("_cmd.json","") + test_case = TestCase(f"{test_case_name}_{test_images[n_image]}_test-{n_image}", cmd, 0, process_output, '') test_cases[n_image].append(test_case) test_ret_code = int(test["ret_code"]) if test.get("ret_code") else 0 @@ -235,7 +239,7 @@ def check(json_file, start, stop, md_article): test_cases[n_image][-1].add_failure_info(msg) results[test_images[n_image]] = results[test_images[n_image]]+1 bar() - logging.info(f"{cmd}\n{msg}") + logging.info(f"{msg}") if not test_passed: logging.debug(f"{process_output}") else: diff --git a/tools/requirements.txt b/tools/requirements.txt index f1d5233716..d6d6d8c9b6 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -3,4 +3,5 @@ pyyaml inclusivewriting pyspellchecker better-profanity -setuptools \ No newline at end of file +setuptools +alive-progress \ No newline at end of file From 18350e23bf24ce370ea7e9a9f719b35c126e7bf3 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 15 Aug 2024 10:34:07 +0200 Subject: [PATCH 005/185] Update test script --- .github/workflows/test-lp.yml | 13 +++++++++++-- .github/workflows/test_lp.sh | 9 ++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 5a9fbf3b40..3a9910b393 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -8,5 +8,14 @@ jobs: - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - name: Check out repository code uses: actions/checkout@v4 - - name: List files in the repository - run: bash ./.github/workflows/test_lp.sh ${{ github.workspace }} + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v44 + - name: Run test suite for all changed files + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file" + ./.github/workflows/test_lp.sh $file + done diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index 2a72b225f1..1573ba6cf8 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,3 +1,6 @@ -echo "HELLO WORLD" -pip install -r $1/tools/requirements.txt -./tools/maintenance.py -i $1/content/install-guides/cmake.md \ No newline at end of file +if file -b --mime-type $1 | grep -q md; then + pip install -r tools/requirements.txt + tools/maintenance.py -i $1 +else + echo "Not an .md file, skipping" +fi \ No newline at end of file From 331528940fb08bf9f383ee1afb09811599f41ff1 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 15 Aug 2024 11:19:33 +0200 Subject: [PATCH 006/185] Update test script --- .github/workflows/test_lp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index 1573ba6cf8..4dcb763012 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,4 +1,4 @@ -if file -b --mime-type $1 | grep -q md; then +if [[ $1 == *.md ]]; then pip install -r tools/requirements.txt tools/maintenance.py -i $1 else From 8a082931552e574f6763c514dd19b9994c484f5e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 12:25:53 +0200 Subject: [PATCH 007/185] Filter changed files in test script - Skip non .md files - Extract unique paths for maintenance --- .github/workflows/test-lp.yml | 6 +---- .github/workflows/test_lp.sh | 41 ++++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 3a9910b393..e5f0623c9b 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -14,8 +14,4 @@ jobs: - name: Run test suite for all changed files env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - run: | - for file in ${ALL_CHANGED_FILES}; do - echo "$file" - ./.github/workflows/test_lp.sh $file - done + run: ./.github/workflows/test_lp.sh ${ALL_CHANGED_FILES} \ No newline at end of file diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index 4dcb763012..5418e0acbe 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,6 +1,35 @@ -if [[ $1 == *.md ]]; then - pip install -r tools/requirements.txt - tools/maintenance.py -i $1 -else - echo "Not an .md file, skipping" -fi \ No newline at end of file +ALL_CHANGED_FILES=$1 + +# Skip non .md files +CHANGED_CONTENT=() +for file in ${ALL_CHANGED_FILES}; do + echo "$file" + if [[ $file == *.md ]]; then + CHANGED_CONTENT+="$file" + else + echo "Not an .md file, skipping" + fi +done + +# Keep full paths for install guides, +# get parent directory for learning paths +CONTENT_PATHS=() +for file in ${CHANGED_CONTENT[@]}; do + parentdir="$(dirname "$file")" + if [[ $parentdir = */install-guides/* ]]; then + CONTENT_PATHS+="$file" + else + CONTENT_PATHS+="$parentdir" + fi +done + +# Make sure each learning path is only tested once +CONTENT_PATHS_UNIQUE=($(echo "$CONTENT_PATHS" | sort -u)) + +# Install dependencies +pip install -r tools/requirements.txt + +# Run the tests +for file in ${CONTENT_PATHS_UNIQUE}; do + tools/maintenance.py -i ${file} +done From c720c1dd2ca4cb233827aca64d72bbf9786e11e1 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 13:12:48 +0200 Subject: [PATCH 008/185] Update test script - Fix bug --- .github/workflows/test-lp.yml | 2 -- .github/workflows/test_lp.sh | 26 +++++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index e5f0623c9b..6fcad680ce 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -4,8 +4,6 @@ jobs: Test-Suite: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - name: Check out repository code uses: actions/checkout@v4 - name: Get changed files diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index 5418e0acbe..0ecaa77e74 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,35 +1,39 @@ -ALL_CHANGED_FILES=$1 +ALL_CHANGED_FILES=$@ + +echo "All changed files: ${ALL_CHANGED_FILES}" # Skip non .md files CHANGED_CONTENT=() -for file in ${ALL_CHANGED_FILES}; do - echo "$file" - if [[ $file == *.md ]]; then - CHANGED_CONTENT+="$file" +for file in ${ALL_CHANGED_FILES[*]}; do + if echo "$file" | grep -q ".md"; then + CHANGED_CONTENT+=("$file") else echo "Not an .md file, skipping" fi done +echo "Changed content: ${CHANGED_CONTENT[*]}" # Keep full paths for install guides, # get parent directory for learning paths CONTENT_PATHS=() -for file in ${CHANGED_CONTENT[@]}; do +for file in ${CHANGED_CONTENT[*]}; do parentdir="$(dirname "$file")" - if [[ $parentdir = */install-guides/* ]]; then - CONTENT_PATHS+="$file" + if echo "$parentdir" | grep -q "install-guides"; then + CONTENT_PATHS+=("$file") else - CONTENT_PATHS+="$parentdir" + CONTENT_PATHS+=("$parentdir") fi done # Make sure each learning path is only tested once -CONTENT_PATHS_UNIQUE=($(echo "$CONTENT_PATHS" | sort -u)) +echo "Content paths: ${CONTENT_PATHS[*]}" +CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) +echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Install dependencies pip install -r tools/requirements.txt # Run the tests -for file in ${CONTENT_PATHS_UNIQUE}; do +for file in ${CONTENT_PATHS_UNIQUE[*]}; do tools/maintenance.py -i ${file} done From dca543479e891d42c0a2c6d61a0de55b6f57ac42 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 13:33:00 +0200 Subject: [PATCH 009/185] Update test script --- .github/workflows/test-lp.yml | 8 ++++- .github/workflows/test_lp.sh | 57 ++++++++++++++--------------------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 6fcad680ce..c774bf4cab 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,7 +1,7 @@ name: Test Learning Path on: push jobs: - Test-Suite: + Test-Pull-Request: runs-on: ubuntu-latest steps: - name: Check out repository code @@ -9,6 +9,12 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 + with: + # Check only Markdown files + files: | + **.md + - name: Install dependencies + run: pip install -r tools/requirements.txt - name: Run test suite for all changed files env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index 0ecaa77e74..bf9954d4be 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,39 +1,28 @@ ALL_CHANGED_FILES=$@ -echo "All changed files: ${ALL_CHANGED_FILES}" +echo "All changed content paths: ${ALL_CHANGED_FILES}" -# Skip non .md files -CHANGED_CONTENT=() -for file in ${ALL_CHANGED_FILES[*]}; do - if echo "$file" | grep -q ".md"; then - CHANGED_CONTENT+=("$file") - else - echo "Not an .md file, skipping" - fi -done -echo "Changed content: ${CHANGED_CONTENT[*]}" +# Install dependencies and run tests, +# if we found tests to run +if [ ${#ALL_CHANGED_FILES[@]} -ne 0 ]; then + # Keep full paths for install guides, + # get parent directory for learning paths + CONTENT_PATHS=() + for file in ${CHANGED_CONTENT[*]}; do + parentdir="$(dirname "$file")" + if echo "$parentdir" | grep -q "install-guides"; then + CONTENT_PATHS+=("$file") + else + CONTENT_PATHS+=("$parentdir") + fi + done -# Keep full paths for install guides, -# get parent directory for learning paths -CONTENT_PATHS=() -for file in ${CHANGED_CONTENT[*]}; do - parentdir="$(dirname "$file")" - if echo "$parentdir" | grep -q "install-guides"; then - CONTENT_PATHS+=("$file") - else - CONTENT_PATHS+=("$parentdir") - fi -done + # Make sure each learning path is only tested once + CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) + echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" -# Make sure each learning path is only tested once -echo "Content paths: ${CONTENT_PATHS[*]}" -CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) -echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" - -# Install dependencies -pip install -r tools/requirements.txt - -# Run the tests -for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} -done + # Run the tests + for file in ${CONTENT_PATHS_UNIQUE[*]}; do + tools/maintenance.py -i ${file} + done +fi \ No newline at end of file From d58d38da3a4dc65f55697f60ca5c3d96694d4275 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 13:42:07 +0200 Subject: [PATCH 010/185] Update test script - Skip steps if no Markdown files are changed --- .github/workflows/test-lp.yml | 2 ++ .github/workflows/test_lp.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index c774bf4cab..e24dc68fcb 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -14,8 +14,10 @@ jobs: files: | **.md - name: Install dependencies + if: steps.changed-files-specific.outputs.any_changed == 'true' run: pip install -r tools/requirements.txt - name: Run test suite for all changed files + if: steps.changed-files-specific.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: ./.github/workflows/test_lp.sh ${ALL_CHANGED_FILES} \ No newline at end of file diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index bf9954d4be..abdfc80daa 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,10 +1,10 @@ ALL_CHANGED_FILES=$@ -echo "All changed content paths: ${ALL_CHANGED_FILES}" # Install dependencies and run tests, # if we found tests to run -if [ ${#ALL_CHANGED_FILES[@]} -ne 0 ]; then +if [ -z "${ALL_CHANGED_FILES[@]}" ]; then + echo "All changed content paths: ${ALL_CHANGED_FILES}" # Keep full paths for install guides, # get parent directory for learning paths CONTENT_PATHS=() From 0fe3ae0d2d12f72f76f2522caa2c20b9b0670c89 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 13:43:53 +0200 Subject: [PATCH 011/185] Run on PR --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index e24dc68fcb..5428e3a26c 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,5 +1,5 @@ name: Test Learning Path -on: push +on: pull_request jobs: Test-Pull-Request: runs-on: ubuntu-latest From ab1df82533a4241bcc67fa6591798c2405e7fe3c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 14:33:43 +0200 Subject: [PATCH 012/185] Update test script --- .github/workflows/test-lp.yml | 16 ++++++------- .github/workflows/test_lp.sh | 43 ++++++++++++++++------------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 5428e3a26c..bdff2933d5 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -6,18 +6,18 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - - name: Get changed files - id: changed-files + - name: Get all changed markdown files + id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Check only Markdown files + # Avoid using single or double quotes for multiline patterns files: | **.md + - name: Install dependencies - if: steps.changed-files-specific.outputs.any_changed == 'true' + if: steps.changed-markdown-files.outputs.any_changed == 'true' run: pip install -r tools/requirements.txt + - name: Run test suite for all changed files - if: steps.changed-files-specific.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - run: ./.github/workflows/test_lp.sh ${ALL_CHANGED_FILES} \ No newline at end of file + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} \ No newline at end of file diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index abdfc80daa..e7cac12f88 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -1,28 +1,23 @@ ALL_CHANGED_FILES=$@ - # Install dependencies and run tests, # if we found tests to run -if [ -z "${ALL_CHANGED_FILES[@]}" ]; then - echo "All changed content paths: ${ALL_CHANGED_FILES}" - # Keep full paths for install guides, - # get parent directory for learning paths - CONTENT_PATHS=() - for file in ${CHANGED_CONTENT[*]}; do - parentdir="$(dirname "$file")" - if echo "$parentdir" | grep -q "install-guides"; then - CONTENT_PATHS+=("$file") - else - CONTENT_PATHS+=("$parentdir") - fi - done - - # Make sure each learning path is only tested once - CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) - echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" - - # Run the tests - for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} - done -fi \ No newline at end of file +echo "All changed content paths: ${ALL_CHANGED_FILES}" +# Keep full paths for install guides, +# get parent directory for learning paths +CONTENT_PATHS=() +for file in ${ALL_CHANGED_FILES[*]}; do + parentdir="$(dirname "$file")" + if echo "$parentdir" | grep -q "install-guides"; then + CONTENT_PATHS+=("$file") + else + CONTENT_PATHS+=("$parentdir") + fi +done +# Make sure each learning path is only tested once +CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) +echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" +# Run the tests +for file in ${CONTENT_PATHS_UNIQUE[*]}; do + tools/maintenance.py -i ${file} +done From c1081883273e03e0a76e5dd03ae1fdc75ad72987 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 19 Aug 2024 16:06:29 +0200 Subject: [PATCH 013/185] Have maintenance script exit upon error --- tools/check.py | 4 ++-- tools/maintenance.py | 27 ++++++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/check.py b/tools/check.py index 00a80805e8..1f64206051 100644 --- a/tools/check.py +++ b/tools/check.py @@ -245,7 +245,7 @@ def check(json_file, start, stop, md_article): else: logging.debug(f"{process_output}") # Remove file with list of commands - os.remove(test_cmd_filename) + os.remove(test_cmd_filename) result = "failed" if results[test_images[n_image]] else "passed" logging.info(f"Tests {result} on {test_image}") @@ -275,4 +275,4 @@ def check(json_file, start, stop, md_article): else: logging.debug("Parameter stop is false, skipping container(s) termination") - return results \ No newline at end of file + return results, result \ No newline at end of file diff --git a/tools/maintenance.py b/tools/maintenance.py index 2065d19c37..5ddb2ceff3 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -3,6 +3,7 @@ import argparse import logging import os +import sys # Local import import report import parse @@ -46,7 +47,8 @@ def check_lp(lp_path, link, debug): # Build dict with weight value for each article article_per_weight = { i: parse.header(lp_path + "/" + i.replace("_cmd.json",""))["weight"] for i in l } # Sort dict by value - res = [] + test_image_results_list = [] + results_list = [] # sort LP by weight value to have it run sequentially for idx, i in enumerate(sorted(article_per_weight.items(), key=lambda item: item[1])): logging.info("Checking " + i[0].replace("_cmd.json","")) @@ -58,7 +60,9 @@ def check_lp(lp_path, link, debug): launch = False if i[1] != -1 and idx != len(article_per_weight.keys())-1: terminate = False - res.append(check.check(lp_path + "/" + i[0], start=launch, stop=terminate, md_article=lp_path)) + test_image_results, result_str = check.check(lp_path + "/" + i[0], start=launch, stop=terminate, md_article=lp_path) + test_image_results_list.append(test_image_results) + results_list.append(result_str) if not debug: for i in os.listdir(lp_path): @@ -68,6 +72,7 @@ def check_lp(lp_path, link, debug): logging.warning(f"Learning Path {lp_path} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") else: logging.warning("No _index.md found in Learning Path") + return results_list """ @@ -91,6 +96,7 @@ def main(): arg_group.add_argument('-r', '--report', metavar='DAYS', action='store', type=int, default=1, help='List articles older than a period in days (default is 1). Output a CSV file. This option is used by default.') args = arg_parser.parse_args() + test_results = [] if args.debug: verbosity = logging.DEBUG @@ -109,7 +115,8 @@ def main(): fn = line.split(",")[0] # Check if this article is a learning path if "/learning-paths/" in os.path.abspath(fn): - check_lp(fn, args.link, args.debug) + result_str = check_lp(fn, args.link, args.debug) + test_results += result_str elif fn.endswith(".md"): logging.info("Parsing " + fn) # check if maintenance if enabled @@ -117,7 +124,8 @@ def main(): cmd = parse.parse(fn) parse.save_commands_to_json(fn, cmd) logging.info("Checking " + fn) - res = check.check(fn+"_cmd.json", start=True, stop=True, md_article=fn) + results_dict, result_str = check.check(fn+"_cmd.json", start=True, stop=True, md_article=fn) + test_results += [result_str] if not args.debug: os.remove(fn+"_cmd.json") else: @@ -127,22 +135,27 @@ def main(): elif args.instructions.endswith(".md"): # Check if this article is a learning path if "/learning-paths/" in os.path.abspath(args.instructions): - check_lp(args.instructions, args.link, args.debug) + result_str = check_lp(args.instructions, args.link, args.debug) + test_results += result_str else: logging.info("Parsing " + args.instructions) # check if maintenance if enabled if parse.header(args.instructions)["test_maintenance"]: cmd = parse.parse(args.instructions) parse.save_commands_to_json(args.instructions, cmd) - res = check.check(args.instructions+"_cmd.json", start=True, stop=True, md_article=args.instructions) + results_dict, result_str = check.check(args.instructions+"_cmd.json", start=True, stop=True, md_article=args.instructions) + test_results += [result_str] if not args.debug: os.remove(args.instructions+"_cmd.json") else: logging.warning(f"{args.instructions} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") elif os.path.isdir(args.instructions) and "/learning-paths/" in os.path.abspath(args.instructions): - check_lp(args.instructions, args.link, args.debug) + result_str = check_lp(args.instructions, args.link, args.debug) + test_results += result_str else: logging.error("-i/--instructions expects a .md file, a CSV with a list of files or a Learning Path directory") + if "failed" in test_results: + sys.exit(1) elif args.spelling: logging.info(f"Checking spelling of {args.spelling}") output = parse.spelling(args.spelling) From c60de9faa8e24d9f1e6afe1796042316c462d093 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 22 Aug 2024 11:02:08 +0200 Subject: [PATCH 014/185] Add results to stats file --- .github/workflows/test-lp.yml | 13 ++++++++++- tools/check.py | 17 ++++---------- tools/maintenance.py | 36 ++++++++++++++++-------------- tools/patch.py | 42 +++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 31 deletions(-) create mode 100644 tools/patch.py diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index bdff2933d5..9bc645d2cd 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -20,4 +20,15 @@ jobs: - name: Run test suite for all changed files if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} \ No newline at end of file + run: ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + if: success() + with: + commit-message: update stats_current_test_info.yml + title: Update stats_current_test_info.yml + body: | + Update test result file with recent run + Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request + branch: update-stats + base: main \ No newline at end of file diff --git a/tools/check.py b/tools/check.py index 1f64206051..cc11788ee5 100644 --- a/tools/check.py +++ b/tools/check.py @@ -185,6 +185,8 @@ def check(json_file, start, stop, md_article): docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] subprocess.run(docker_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) logging.debug(docker_cmd) + # Remove file with list of commands + os.remove(test_cmd_filename) test_type = test["type"] # Check type @@ -244,22 +246,11 @@ def check(json_file, start, stop, md_article): logging.debug(f"{process_output}") else: logging.debug(f"{process_output}") - # Remove file with list of commands - os.remove(test_cmd_filename) + result = "failed" if results[test_images[n_image]] else "passed" logging.info(f"Tests {result} on {test_image}") - # add to test suite and write junit results - ts = [] - for n_instance in range(0, len(test_images)): - ts.append(TestSuite(f"{json_file} {test_images[n_instance]}", test_cases[n_instance])) - json_file_name = json_file.replace(".json", ".xml") - - with open(json_file_name, mode='w') as lFile: - TestSuite.to_file(lFile, ts, prettyprint=True) - lFile.close() - # Stop instance if stop: logging.debug("Terminating container(s)") @@ -275,4 +266,4 @@ def check(json_file, start, stop, md_article): else: logging.debug("Parameter stop is false, skipping container(s) termination") - return results, result \ No newline at end of file + return results \ No newline at end of file diff --git a/tools/maintenance.py b/tools/maintenance.py index 5ddb2ceff3..9fb532028a 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -7,6 +7,7 @@ # Local import import report import parse +import patch import check import filter_checker @@ -48,7 +49,6 @@ def check_lp(lp_path, link, debug): article_per_weight = { i: parse.header(lp_path + "/" + i.replace("_cmd.json",""))["weight"] for i in l } # Sort dict by value test_image_results_list = [] - results_list = [] # sort LP by weight value to have it run sequentially for idx, i in enumerate(sorted(article_per_weight.items(), key=lambda item: item[1])): logging.info("Checking " + i[0].replace("_cmd.json","")) @@ -60,9 +60,8 @@ def check_lp(lp_path, link, debug): launch = False if i[1] != -1 and idx != len(article_per_weight.keys())-1: terminate = False - test_image_results, result_str = check.check(lp_path + "/" + i[0], start=launch, stop=terminate, md_article=lp_path) + test_image_results = check.check(lp_path + "/" + i[0], start=launch, stop=terminate, md_article=lp_path) test_image_results_list.append(test_image_results) - results_list.append(result_str) if not debug: for i in os.listdir(lp_path): @@ -72,7 +71,7 @@ def check_lp(lp_path, link, debug): logging.warning(f"Learning Path {lp_path} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") else: logging.warning("No _index.md found in Learning Path") - return results_list + return test_image_results """ @@ -96,7 +95,6 @@ def main(): arg_group.add_argument('-r', '--report', metavar='DAYS', action='store', type=int, default=1, help='List articles older than a period in days (default is 1). Output a CSV file. This option is used by default.') args = arg_parser.parse_args() - test_results = [] if args.debug: verbosity = logging.DEBUG @@ -105,9 +103,11 @@ def main(): logging.debug("Verbosity level is set to " + level[verbosity]) if args.instructions: + if not os.path.exists(args.instructions): + raise FileNotFoundError(f"No such file or directory: {args.instructions}") + results_dict = {} # check if article is a csv file corresponding to a file list if args.instructions.endswith(".csv"): - # TODO idea: separate parsing of CSV into list, run in same way as a single one passed logging.info("Parsing CSV " + args.instructions) with open(args.instructions) as f: next(f) # skip header @@ -115,8 +115,7 @@ def main(): fn = line.split(",")[0] # Check if this article is a learning path if "/learning-paths/" in os.path.abspath(fn): - result_str = check_lp(fn, args.link, args.debug) - test_results += result_str + results_dict = check_lp(fn, args.link, args.debug) elif fn.endswith(".md"): logging.info("Parsing " + fn) # check if maintenance if enabled @@ -124,37 +123,40 @@ def main(): cmd = parse.parse(fn) parse.save_commands_to_json(fn, cmd) logging.info("Checking " + fn) - results_dict, result_str = check.check(fn+"_cmd.json", start=True, stop=True, md_article=fn) - test_results += [result_str] + results_dict = check.check(fn+"_cmd.json", start=True, stop=True, md_article=fn) if not args.debug: os.remove(fn+"_cmd.json") else: logging.warning(f"{fn} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") + sys.exit(0) else: logging.error("Unknown type " + fn) elif args.instructions.endswith(".md"): # Check if this article is a learning path if "/learning-paths/" in os.path.abspath(args.instructions): - result_str = check_lp(args.instructions, args.link, args.debug) - test_results += result_str + results_dict = check_lp(args.instructions, args.link, args.debug) else: logging.info("Parsing " + args.instructions) # check if maintenance if enabled if parse.header(args.instructions)["test_maintenance"]: cmd = parse.parse(args.instructions) parse.save_commands_to_json(args.instructions, cmd) - results_dict, result_str = check.check(args.instructions+"_cmd.json", start=True, stop=True, md_article=args.instructions) - test_results += [result_str] + results_dict = check.check(args.instructions+"_cmd.json", start=True, stop=True, md_article=args.instructions) if not args.debug: os.remove(args.instructions+"_cmd.json") else: logging.warning(f"{args.instructions} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") + sys.exit(0) elif os.path.isdir(args.instructions) and "/learning-paths/" in os.path.abspath(args.instructions): - result_str = check_lp(args.instructions, args.link, args.debug) - test_results += result_str + results_dict = check_lp(args.instructions, args.link, args.debug) + if not args.debug: + os.remove(args.instructions+"_cmd.json") else: logging.error("-i/--instructions expects a .md file, a CSV with a list of files or a Learning Path directory") - if "failed" in test_results: + # If all test results are zero, all tests have passed + patch.patch(args.instructions, results_dict, args.link) + if not all(results_dict.get(k) for k in results_dict): + # Errors exist sys.exit(1) elif args.spelling: logging.info(f"Checking spelling of {args.spelling}") diff --git a/tools/patch.py b/tools/patch.py new file mode 100644 index 0000000000..8f0c8bc693 --- /dev/null +++ b/tools/patch.py @@ -0,0 +1,42 @@ +import yaml +from collections import defaultdict +from pathlib import PurePath +import re + +""" +Parse results and patch stats file with test results +""" +def patch(article_path: str, results: dict, link: str): + stats_file = "data/stats_current_test_info.yml" + + with open(stats_file, mode='r') as f: + data = yaml.safe_load(f) + f.close() + + article_path_pure = PurePath(re.sub(r"^.*?content/", "", article_path)) + print(article_path_pure) + article_path_parts = list(article_path_pure.parts) + if "learning-paths" in article_path_parts: + content_type, sw_category, content_title = article_path_parts + article_path = PurePath(article_path, "_index.md") + elif "install-guides" in article_path_parts: + content_type, content_title = article_path_parts + content_title = content_title.strip(".md") + sw_category = content_type + else: + raise IOError("Unknown content path, pass learning paths or install guides only") + + test_images = results.keys() + results_values = defaultdict(lambda: "failed") + results_values[0] = "passed" + + for image, i in zip(test_images, range(len(test_images))): + data["sw_categories"][sw_category][content_title]["tests_and_status"][i][image] = results_values[results[image]] + + if link: + data["sw_categories"][sw_category][content_title]["test_link"] = link + + + with open(stats_file, mode='w') as f: + yaml.dump(data, f) + f.close() \ No newline at end of file From b9969807e97647e7d581474c8d9c828ac6a8dbfa Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 4 Sep 2024 11:01:45 +0200 Subject: [PATCH 015/185] Update docs and bug fixes of patching --- .../_example-learning-path/appendix-3-test.md | 63 +++++++++---------- tools/check.py | 6 +- tools/maintenance.py | 7 ++- tools/patch.py | 3 + 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md b/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md index ca3b11bbfd..190da68f80 100644 --- a/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md +++ b/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md @@ -62,7 +62,8 @@ The framework will check the return code. If not 0, an error will be reported. If a specific return code is expected, it can be specified as follows: ```markdown - The file myfile.txt doesn't exist yet and this command returns 1: + The file myfile.txt doesn't exist yet + and this command should return 1: ```bash { ret_code="1" } test -f myfile.txt @@ -71,16 +72,21 @@ If a specific return code is expected, it can be specified as follows: #### Command output -When a command output is displayed in the instructions: +You can display the shell which the command should run in by specifying the `command_line` option. You can also test for expected output in the instructions by specifying the line(s) where the expected output should be displayed. This is done by adding the pipe symbol (`|`). Since the first line should contain the command itself, the indexing of the expected output lines starts at 2. You can specify a span (if the expected output is more than one line) with the dash symbol, for example `"| 2-10"`. ```markdown Let's check is this command return the expected output: - ```bash { command_line="root@localhost | 2 } + ```bash { command_line="root@localhost | 2" } echo "hello world" hello world ``` ``` +The code above renders to display the shell identity to the reader: +```bash { command_line="root@localhost | 2" } +echo "hello world" +hello world +``` The framework will check if the command returns the same output and report an error otherwise. @@ -115,7 +121,7 @@ It is important to note that the framework does run each code block as a separat This command will fail: - ```bash { ret_code="1" } + ```bash test -f myfile.txt ``` @@ -210,7 +216,7 @@ test_images: The `test_maintenance` field is a boolean that enables the framework. -The `test_images` field is a list of Docker container images the framework can pull to test the Learning Path instructions. Check [Docker Hub](https://hub.docker.com/) to explore available images. +The `test_images` field is a list of Docker container images the framework can pull to test the Learning Path instructions. Check [Docker Hub](https://hub.docker.com/) to explore available images. ## Run the framework @@ -228,48 +234,41 @@ Specify the `.md` file directly for single file tool install articles. ./tools/maintenance.py -i content/install-guides/mytool.md ``` -## Result summary - -The framework patches the metadata in the Learning Path's `_index.md` file or the .md file of the tool install to add a summary of the test status. - -```yaml -test_maintenance: true -test_images: -- ubuntu:latest -- fedora:latest -test_status: -- passed -- failed -``` +If the tests are successful, that will be communicated through the console. -The field `test_status` is a list that indicated whether all tests passed for a corresponding Docker container image or if at least one test failed. +### Investigating failures -In the example above, the summary indicates that for this Learning Path all tests passed for the image `ubuntu:latest` but at least one test failed for the image `fedora:latest`. More information about the failures are stored in Junit XML files. +The framework will print information about any errors to the console. For a more refined analysis, add the `--debug` flag. -## Visualize results +```bash +./tools/maintenance.py -i content/install-guides/mytool.md --debug +``` -Test results are stored in XML Junit files. One XML file is created by Learning Path sub-article. -It is possible to visualize the results in a web browser. The XML files can be converted with [xunit-viewer](https://www.npmjs.com/package/xunit-viewer). +### Saving the results -If not already installed, install [Node.js](https://nodejs.org/en/) and run: +If you want the results to be saved, add the `--stats-report` flag to the command. This will update a statistics file which publishes the result to the website. +```bash +./tools/maintenance.py -i content/install-guides/mytool.md --stats-report ``` -npm i -g xunit-viewer + +```yaml +tests_and_status: + - ubuntu:latest: passed + - fedora:latest: failed ``` -Then, launch the web server (e.g. on port 5050) on the folder where the XML Junit files have been created: +The field `tests_and_status` is a list that indicated whether all tests passed for a corresponding Docker container image or if at least one test failed. -``` -xunit-viewer -r content/learning-paths/servers-and-cloud-computing/mynewlearningpath/ -s -p 5050 -``` +In the example above, the summary indicates that for this Learning Path all tests passed for the image `ubuntu:latest` but at least one test failed for the image `fedora:latest`. More information about the failures can be found in the console. ## Advanced usage for embedded development -#### Using the Corstone-300 FVP +### Using the Corstone-300 FVP -By default, the framework runs instructions on the Docker images specified by the [metadata](#edit-metadata). For embedded development, it is possible to build software in a container instance and then check its behaviour on the Corstone-300 FVP. +By default, the framework runs instructions on the Docker images specified by the [metadata](#edit-metadata). For embedded development, it is possible to build software in a container instance and then check its behaviour on the Corstone-300 FVP. -For this, all container instances used by the test framework mount a volume in `/shared`. This is where software for the target FVP can be stored. To check the execution, the FVP commands just need to be identified as a `fvp` section for the framework. +For this, all container instances used by the test framework mount a volume in `/shared`. This is where software for the target FVP can be stored. To check the execution, the FVP commands just need to be identified as a `fvp` section for the framework. For example: diff --git a/tools/check.py b/tools/check.py index cc11788ee5..8cf58aa1aa 100644 --- a/tools/check.py +++ b/tools/check.py @@ -183,7 +183,7 @@ def check(json_file, start, stop, md_article): # Copy over the file with commands docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] - subprocess.run(docker_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + subprocess.run(docker_cmd, shell=True, capture_output=True) logging.debug(docker_cmd) # Remove file with list of commands os.remove(test_cmd_filename) @@ -209,7 +209,7 @@ def check(json_file, start, stop, md_article): continue logging.debug(docker_cmd) - process = subprocess.run(docker_cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE) + process = subprocess.run(docker_cmd, shell=True, check=False, capture_output=True) process_output = process.stdout.rstrip().decode("utf-8") # Create test case @@ -243,7 +243,7 @@ def check(json_file, start, stop, md_article): bar() logging.info(f"{msg}") if not test_passed: - logging.debug(f"{process_output}") + logging.info(f"{process.stderr.rstrip().decode("utf-8")}") else: logging.debug(f"{process_output}") diff --git a/tools/maintenance.py b/tools/maintenance.py index 9fb532028a..a5dee7daa8 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -86,6 +86,7 @@ def main(): arg_parser.add_argument('-l', '--link', metavar='URL', action='store', type=str, help='Specify URL to github actions report. Added when patching sources files with --instructions') arg_parser.add_argument('-p', '--patch', action='store_true', help='Patch categories _index.md with results when using --filter-checker') arg_parser.add_argument('-t', '--type', metavar='REPORT', action='store', default='all', type=str, help='Specify report type detailing the closed filter status when using --filter-checker. Can be either \'all\', \'subjects\', \'softwares\', \'oses\', \'tools\'') + arg_parser.add_argument('-sr', '--stats-report', action='store_true', help='Added when patching statistics file with --instructions') arg_group = arg_parser.add_mutually_exclusive_group() arg_group.add_argument('-f', '--filter-checker', action='store_true', help='Validates the correct closed schema filters are being used, reports any errors, and optionally updates _index.md files for each learning path category to reflect the currently supported filters.') @@ -153,8 +154,10 @@ def main(): os.remove(args.instructions+"_cmd.json") else: logging.error("-i/--instructions expects a .md file, a CSV with a list of files or a Learning Path directory") - # If all test results are zero, all tests have passed - patch.patch(args.instructions, results_dict, args.link) + if args.stats_report: + # If all test results are zero, all tests have passed + patch.patch(args.instructions, results_dict, args.link) + if not all(results_dict.get(k) for k in results_dict): # Errors exist sys.exit(1) diff --git a/tools/patch.py b/tools/patch.py index 8f0c8bc693..5570a7cbf3 100644 --- a/tools/patch.py +++ b/tools/patch.py @@ -31,6 +31,9 @@ def patch(article_path: str, results: dict, link: str): results_values[0] = "passed" for image, i in zip(test_images, range(len(test_images))): + if content_title not in data["sw_categories"][sw_category]: + raise KeyError(f"{content_title} does not exist in {stats_file}. Add it to update the stats report.") + data["sw_categories"][sw_category][content_title]["tests_and_status"][i][image] = results_values[results[image]] if link: From 112270729a09d0bc770e2abd1e24a962f46e943b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 5 Sep 2024 09:47:50 +0200 Subject: [PATCH 016/185] Capture error --- tools/check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/check.py b/tools/check.py index 8cf58aa1aa..bbead760df 100644 --- a/tools/check.py +++ b/tools/check.py @@ -211,6 +211,7 @@ def check(json_file, start, stop, md_article): logging.debug(docker_cmd) process = subprocess.run(docker_cmd, shell=True, check=False, capture_output=True) process_output = process.stdout.rstrip().decode("utf-8") + process_error = process.stderr.rstrip().decode("utf-8") # Create test case test_case_name = json_file.replace("_cmd.json","") @@ -243,7 +244,7 @@ def check(json_file, start, stop, md_article): bar() logging.info(f"{msg}") if not test_passed: - logging.info(f"{process.stderr.rstrip().decode("utf-8")}") + logging.info(f"{process_error}") else: logging.debug(f"{process_output}") From 72fa7d863786a8b8f69f75886dd6b96dee40bd4d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 5 Sep 2024 11:05:12 +0200 Subject: [PATCH 017/185] Fix file removal --- tools/check.py | 2 -- tools/maintenance.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/tools/check.py b/tools/check.py index bbead760df..4d12574e60 100644 --- a/tools/check.py +++ b/tools/check.py @@ -185,8 +185,6 @@ def check(json_file, start, stop, md_article): docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] subprocess.run(docker_cmd, shell=True, capture_output=True) logging.debug(docker_cmd) - # Remove file with list of commands - os.remove(test_cmd_filename) test_type = test["type"] # Check type diff --git a/tools/maintenance.py b/tools/maintenance.py index a5dee7daa8..9edcaa2e55 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -150,14 +150,11 @@ def main(): sys.exit(0) elif os.path.isdir(args.instructions) and "/learning-paths/" in os.path.abspath(args.instructions): results_dict = check_lp(args.instructions, args.link, args.debug) - if not args.debug: - os.remove(args.instructions+"_cmd.json") else: logging.error("-i/--instructions expects a .md file, a CSV with a list of files or a Learning Path directory") if args.stats_report: # If all test results are zero, all tests have passed patch.patch(args.instructions, results_dict, args.link) - if not all(results_dict.get(k) for k in results_dict): # Errors exist sys.exit(1) From 53d5cd2cd6e1ecbb9f0472227ce99806a2b60591 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:13:58 +0200 Subject: [PATCH 018/185] Create test-lp.yml Add workflow file for testing script --- .github/workflows/test-lp.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/test-lp.yml diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml new file mode 100644 index 0000000000..fb0c894272 --- /dev/null +++ b/.github/workflows/test-lp.yml @@ -0,0 +1,47 @@ +name: Test Learning Path +on: pull_request +jobs: + Test-Pull-Request: + runs-on: arm-linux-runner + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Get all changed markdown files + id: changed-markdown-files + uses: tj-actions/changed-files@v44 + with: + # Avoid using single or double quotes for multiline patterns + files: | + **.md + - name: Install dependencies + if: steps.changed-markdown-files.outputs.any_changed == 'true' + run: pip install -r tools/requirements.txt + + - name: Run test suite for all changed files + id: run-suite + if: steps.changed-markdown-files.outputs.any_changed == 'true' + # Run the test suite, and then determine if maintenance is turned off + run: | + set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt + - name: Parse maintenance state + id: maintenance-state + if: success() + # Check if maintenance is turned off + run: | + cat output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ + || echo "{MAINTENANCE}=on" >> "$GITHUB_ENV" + - name: Test condition + if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'off' + # Skip opening a PR if tests have not been run + run: echo "Maintenance is turned off for one or more files, skipping tests" + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'on' + with: + commit-message: update stats_current_test_info.yml + title: Update stats_current_test_info.yml + body: | + Update test result file with recent run + Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request + branch: update-stats + base: main From cca9468eecfcbb1962a9b5182e2d6c2e9de66e7d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 5 Sep 2024 13:58:35 +0200 Subject: [PATCH 019/185] Handle maintenance turned off --- .github/workflows/test-lp.yml | 19 ++++++++++++++++--- tools/check.py | 20 ++++++++++++++------ tools/maintenance.py | 2 +- tools/parse.py | 2 +- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 9bc645d2cd..4fc7d94873 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -13,17 +13,30 @@ jobs: # Avoid using single or double quotes for multiline patterns files: | **.md - - name: Install dependencies if: steps.changed-markdown-files.outputs.any_changed == 'true' run: pip install -r tools/requirements.txt - name: Run test suite for all changed files + id: run-suite if: steps.changed-markdown-files.outputs.any_changed == 'true' - run: ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} + # Run the test suite, and then determine if maintenance is turned off + run: | + set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt + - name: Parse maintenance state + id: maintenance-state + if: success() + # Check if maintenance is turned off + run: | + cat output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ + || echo "{MAINTENANCE}=on" >> "$GITHUB_ENV" + - name: Test condition + if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'off' + # Skip opening a PR if tests have not been run + run: echo "Maintenance is turned off for one or more files, skipping tests" - name: Create Pull Request uses: peter-evans/create-pull-request@v6 - if: success() + if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'on' with: commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml diff --git a/tools/check.py b/tools/check.py index 4d12574e60..350532c792 100644 --- a/tools/check.py +++ b/tools/check.py @@ -4,7 +4,7 @@ import os import subprocess import json -from junit_xml import TestSuite, TestCase +from junit_xml import TestCase import alive_progress """ @@ -185,6 +185,8 @@ def check(json_file, start, stop, md_article): docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] subprocess.run(docker_cmd, shell=True, capture_output=True) logging.debug(docker_cmd) + # Remove the file storing the command since we now copied it to container + os.remove(test_cmd_filename) test_type = test["type"] # Check type @@ -207,7 +209,7 @@ def check(json_file, start, stop, md_article): continue logging.debug(docker_cmd) - process = subprocess.run(docker_cmd, shell=True, check=False, capture_output=True) + process = subprocess.run(docker_cmd, shell=True, capture_output=True) process_output = process.stdout.rstrip().decode("utf-8") process_error = process.stderr.rstrip().decode("utf-8") @@ -229,7 +231,7 @@ def check(json_file, start, stop, md_article): test_passed = True msg = "PASSED" else: - msg = f"ERROR. Expected {exp}. Run with --debug to see output." + msg = f"ERROR. Expected '{exp}'" test_cases[n_image][-1].add_failure_info(msg) results[test_images[n_image]] = results[test_images[n_image]]+1 else: @@ -240,16 +242,22 @@ def check(json_file, start, stop, md_article): test_cases[n_image][-1].add_failure_info(msg) results[test_images[n_image]] = results[test_images[n_image]]+1 bar() - logging.info(f"{msg}") - if not test_passed: + if not test_passed and process_error: logging.info(f"{process_error}") + elif not test_passed and process_output: + logging.info(f"{process_output}") else: logging.debug(f"{process_output}") - + logging.info(f"{msg}") + logging.info("---------") result = "failed" if results[test_images[n_image]] else "passed" logging.info(f"Tests {result} on {test_image}") + # Remove command file if no tests existed + if os.path.exists(test_cmd_filename): + os.remove(test_cmd_filename) + # Stop instance if stop: logging.debug("Terminating container(s)") diff --git a/tools/maintenance.py b/tools/maintenance.py index 9edcaa2e55..e66993fce9 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -155,7 +155,7 @@ def main(): if args.stats_report: # If all test results are zero, all tests have passed patch.patch(args.instructions, results_dict, args.link) - if not all(results_dict.get(k) for k in results_dict): + if all(results_dict.get(k) for k in results_dict): # Errors exist sys.exit(1) elif args.spelling: diff --git a/tools/parse.py b/tools/parse.py index 5d6adeacb4..b6db15d21c 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -190,7 +190,7 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): if arg in cmd_str: arg_str = cmd_str.split(arg)[1].split("\"")[0] content[cmd_idx].update({arg:arg_str}) - if "|" in cmd_str: + if "|" in cmd_lines_header: expected_result = cmd_str.split("| ")[1].split("\"")[0].split("-") if len(expected_result) > 1: expected_lines = list(range(*[int(x)-1 for x in expected_result])) From d9962bd17c9f7ae400ae0aa569c88be3adf579a8 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 18 Oct 2024 16:29:22 +0200 Subject: [PATCH 020/185] Skip container for bash commands - Always exit when test_maintenance is false - Run bash commands without containerization --- tools/check.py | 70 ++++++++++++++++++++++++++------------------ tools/maintenance.py | 2 +- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/tools/check.py b/tools/check.py index 350532c792..f658997ff1 100644 --- a/tools/check.py +++ b/tools/check.py @@ -17,7 +17,9 @@ def dictionary_lookup(dictionary, key): assert value return True except Exception: - raise KeyError(f"\"{key}\" was not found in dictionary.") + logging.debug(f"\"{key}\" was not found in dictionary {dictionary}.") + return False + """ Initializes a Docker container and runs a few commands to set it up. @@ -129,15 +131,11 @@ def check(json_file, start, stop, md_article): with open(json_file) as jf: data = json.load(jf) - # Start instances for all images - dictionary_lookup(data, "test_images") - test_images = data["test_images"] - if start: - for i_img, img in enumerate(test_images): - container_name = init_container(i_img=i_img, img=img) - logging.info(f"{container_name} initialized") + if dictionary_lookup(data, "test_images"): + test_images = data["test_images"] else: - logging.debug("Parameter start is false, skipping container(s) initialization") + logging.info(f"No test_images could be parsed from {md_article}, skipping") + return {} # Create one test suite for each image test_cases= [[] for img in test_images] @@ -145,10 +143,7 @@ def check(json_file, start, stop, md_article): results = {img:0 for img in test_images} # Check if there are tests / code blocks - try: - dictionary_lookup(data, "ntests") - except KeyError as err: - logging.error(err) + if not dictionary_lookup(data, "ntests"): logging.info(f"No tests were parsed from {md_article}, skipping") return results @@ -158,8 +153,11 @@ def check(json_file, start, stop, md_article): logging.info(f"--- Testing on {test_image} ---") with alive_progress.alive_bar(data["ntests"], title=test_image, stats=False) as bar: for n_test in range(0, data["ntests"]): - dictionary_lookup(data, f"{n_test}") - test = data[f"{n_test}"] + if dictionary_lookup(data, f"{n_test}"): + test = data[f"{n_test}"] + else: + logging.info(f"Error getting test from JSON file, skipping") + continue test_target = test.get("target") if test_target and test_target != test_image: @@ -181,38 +179,54 @@ def check(json_file, start, stop, md_article): username = "ubuntu" if "arm-tools" in test_images[0] else "user" - # Copy over the file with commands - docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] - subprocess.run(docker_cmd, shell=True, capture_output=True) - logging.debug(docker_cmd) - # Remove the file storing the command since we now copied it to container - os.remove(test_cmd_filename) - test_type = test["type"] # Check type - if test_type == "fvp": + if test_type == "bash": + # chmod cmd file + run_command = [f"chmod +x {test_cmd_filename}"] + subprocess.run(run_command, shell=True, capture_output=True) + logging.debug(run_command) + # execute file as is with bash + run_command = [f"./{test_cmd_filename}"] + elif test_type == "fvp": + # Start instance for image + if start: + container_name = init_container(i_img=n_image, img=test_image) + logging.info(f"{container_name} initialized") + else: + logging.debug("Parameter start is false, skipping container(s) initialization") + + # copy files to docker + docker_cmd = [f"docker cp {test_cmd_filename} test_{n_image}:/home/{username}/"] + subprocess.run(docker_cmd, shell=True, capture_output=True) + logging.debug(docker_cmd) + + ethos_u65 = "" fvp_name = test["fvp_name"] if fvp_name == "FVP_Corstone_SSE-300_Ethos-U65": ethos_u65 = "ETHOS_U65=1 -e" test_cwd = test["cwd"] # Only allow single line commands - docker_cmd = test["0"].replace(f"{fvp_name}", + run_command = test["0"].replace(f"{fvp_name}", f"docker run --rm -ti -v $PWD/shared:/shared -w {test_cwd} -e \ {ethos_u65} NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp" ) - elif test_type == "bash": - docker_cmd = [f"docker exec -u {username} -w /home/{username} test_{n_image} bash {test_cmd_filename}"] else: logging.debug(f"Type '{test_type}' not supported for testing. Contact the maintainers if you think this is a mistake.") bar(skipped=True) continue - logging.debug(docker_cmd) - process = subprocess.run(docker_cmd, shell=True, capture_output=True) + + + logging.debug(run_command) + process = subprocess.run(run_command, shell=True, capture_output=True) process_output = process.stdout.rstrip().decode("utf-8") process_error = process.stderr.rstrip().decode("utf-8") + # Remove the file storing the command since we now ran it + os.remove(test_cmd_filename) + # Create test case test_case_name = json_file.replace("_cmd.json","") test_case = TestCase(f"{test_case_name}_{test_images[n_image]}_test-{n_image}", diff --git a/tools/maintenance.py b/tools/maintenance.py index e66993fce9..666a3e847a 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -41,7 +41,6 @@ def check_lp(lp_path, link, debug): # Generate _cmd.json file with instructions parse.save_commands_to_json(_k, cmd, idx_header["test_maintenance"], idx_header["test_images"]) - logging.info("Checking Learning Path " + lp_path) # Look for _cmd.json l = [i for i in os.listdir(lp_path) if i.endswith("_cmd.json")] @@ -69,6 +68,7 @@ def check_lp(lp_path, link, debug): os.remove(lp_path+"/"+i) else: logging.warning(f"Learning Path {lp_path} maintenance is turned off. Add or set \"test_maintenance: true\" otherwise.") + exit(0) else: logging.warning("No _index.md found in Learning Path") return test_image_results From 0bc88ccc65896f632421c60f64d31f4a460ba147 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 21 Oct 2024 15:26:54 +0200 Subject: [PATCH 021/185] Add armclang.md to test framework --- content/install-guides/armclang.md | 36 ++++++++++++------------------ 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/content/install-guides/armclang.md b/content/install-guides/armclang.md index d0667b94ff..7c31a0fb2f 100644 --- a/content/install-guides/armclang.md +++ b/content/install-guides/armclang.md @@ -13,12 +13,8 @@ multitool_install_part: false official_docs: https://developer.arm.com/documentation/100748 test_images: - ubuntu:latest -- fedora:latest test_link: null -test_maintenance: false -test_status: -- passed -- passed +test_maintenance: true title: Arm Compiler for Embedded tool_install: true weight: 1 @@ -57,7 +53,7 @@ These can either be used standalone or [integrated](#armds) into your Arm Develo See also: [What should I do if I want to download a legacy release of Arm Compiler?](https://developer.arm.com/documentation/ka005184) -See [Arm Product Download Hub](/install-guides/pdh/) for additional information on usage. +See [Arm Product Download Hub](../pdh) for additional information on usage. ### Install compiler packages @@ -67,22 +63,17 @@ win-x86_64\setup.exe ``` To install on Linux hosts, `untar` the downloaded package and run the install script (note the exact filenames are version and host dependent). For example: -#### x86_64 -```console -mkdir tmp -mv ARMCompiler6.22_standalone_linux-x86_64.tar.gz tmp -cd tmp -tar xvfz ARMCompiler6.22_standalone_linux-x86_64.tar.gz -./install_x86_64.sh --i-agree-to-the-contained-eula --no-interactive -d /home/$USER/ArmCompilerforEmbedded6.22 -``` -#### aarch64 +#### Linux +The `uname -m` call is used to determine whether your machine is running `aarch64` or `x86_64`, and target the downloaded package accordingly. + ```console mkdir tmp -mv ARMCompiler6.22_standalone_linux-aarch64.tar.gz tmp +mv ARMCompiler6.22_standalone_linux-`uname -m`.tar.gz tmp cd tmp -tar xvfz ARMCompiler6.22_standalone_linux-aarch64.tar.gz -./install_aarch64.sh --i-agree-to-the-contained-eula --no-interactive -d /home/$USER/ArmCompilerforEmbedded6.22 +tar xvfz ARMCompiler6.22_standalone_linux-`uname -m`.tar.gz +./install_`uname -m`.sh --i-agree-to-the-contained-eula --no-interactive -d /home/$USER/ArmCompilerforEmbedded6.22 ``` + Remove the install data when complete. ```console cd .. @@ -102,16 +93,17 @@ armclang --version ### Arm Tools Artifactory {#artifactory} -The Arm Compiler for Embedded, as well as other tools and utilities are available in the [Arm Tools Artifactory](https://www.keil.arm.com/artifacts/). The Keil Studio VS Code [Extensions](/install-guides/keilstudio_vs/) use the artifactory to fetch and install and the necessary components. +The Arm Compiler for Embedded, as well as other tools and utilities are available in the [Arm Tools Artifactory](https://www.keil.arm.com/artifacts/). The Keil Studio VS Code [Extensions](../keilstudio_vs) use the artifactory to fetch and install and the necessary components. Available packages can also be fetched directly from the artifactory. This is particularly useful for automated CI/CD flows. -```command +```bash wget https://artifacts.tools.arm.com/arm-compiler/6.22/45/standalone-linux-armv8l_64-rel.tar.gz ``` Note that the artifactory packages do not have their own installers. You should manually extract files and configure, for example: -```command + +```bash mkdir ArmCompilerforEmbedded6.22 tar xvzf ./standalone-linux-armv8l_64-rel.tar.gz -C ./ArmCompilerforEmbedded6.22 --strip-components=1 rm ./standalone-linux-armv8l_64-rel.tar.gz @@ -121,7 +113,7 @@ export AC6_TOOLCHAIN_6_22_0=/home/$USER/ArmCompilerforEmbedded6.22/bin ## Set up the product license -Arm Compiler for Embedded and Arm Compiler for Embedded FuSa are license managed. License setup instructions are available in the [Arm Licensing install guide](/install-guides/license/). +Arm Compiler for Embedded and Arm Compiler for Embedded FuSa are license managed. License setup instructions are available in the [Arm Licensing install guide](../license/). ## Verify installation From 3497229bbe5d3e4a3344c4a1bbd9fc58fbc47ad6 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 12 Sep 2024 17:00:48 +0200 Subject: [PATCH 022/185] Add Linux-based Install Guides to automatic testing - More to come --- content/install-guides/ambaviz.md | 18 +++++--- content/install-guides/ams.md | 5 ++- content/install-guides/ansible.md | 8 ++-- content/install-guides/aperf.md | 50 ++++++++++----------- content/install-guides/arduino-pico.md | 15 ++++--- content/install-guides/armds.md | 6 ++- content/install-guides/armie.md | 27 ++++++----- content/install-guides/armpl.md | 13 +++--- content/install-guides/aws-cli.md | 13 +++--- content/install-guides/aws-copilot.md | 9 ++-- content/install-guides/aws-greengrass-v2.md | 19 ++++---- content/install-guides/azure-cli.md | 20 +++++---- content/install-guides/bolt.md | 43 +++++++++++------- data/stats_current_test_info.yml | 48 ++++++++++++++++++++ tools/check.py | 1 - 15 files changed, 181 insertions(+), 114 deletions(-) diff --git a/content/install-guides/ambaviz.md b/content/install-guides/ambaviz.md index 242f192567..bef612b0d7 100644 --- a/content/install-guides/ambaviz.md +++ b/content/install-guides/ambaviz.md @@ -27,6 +27,10 @@ tool_install: true # Set to true to be listed in main selection pag multi_install: false # Set to true if first page of multi-page article, else false multitool_install_part: false # Set to true if a sub-page of a multi-page article, else false layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles +test_maintenance: true +test_images: +- ubuntu:latest + --- [Arm AMBA Viz](https://www.arm.com/products/development-tools/embedded-and-software/amba-viz) is a tool to visualize AMBA events to accelerate SoC verification. This guide is for SoC verification and validation engineers to efficiently analyze hardware signals in their designs. @@ -49,23 +53,23 @@ AMBA Viz requires a Linux host machine with Java 11 or JavaFX. Extract the software from the bundle to the desired install location. For example: -```command +```console tar -xf ambaviz.tar.gz ``` Navigate to the newly-created `ambaviz-` folder, and run the following script to set up environment variables: #### sh/bash -```command +```console source sourceMe.sh ``` #### csh -```command +```console sourceMe.csh ``` The AMBA Viz Release Notes provide full installation instructions, located in the extracted directory at: -```command +```console docs/public/assets/pdfs/ambaviz-release-note.pdf ``` @@ -78,17 +82,17 @@ License set up instructions are available in the [Arm License install guide](/in ## Get started Typically, AMBA Viz is launched with a waveform file: -```command +```console ambaviz -f ``` A proprietary `AVDB` waveform format is recommended to improve the performance of AMBA Viz. To convert `VCD` or `FSDB` files to this format, use the `wave2avdb` script, for example: -```command +```console wave2avdb -d cmn600 -f waves.vcd -o waves.avdb ``` The User Guide provides full usage instructions, located in the extracted directory at: -```command +```console docs/public/assets/pdfs/ambaviz-user-guide.pdf ``` diff --git a/content/install-guides/ams.md b/content/install-guides/ams.md index ae2540ffa3..e2f7cf5d13 100644 --- a/content/install-guides/ams.md +++ b/content/install-guides/ams.md @@ -28,6 +28,9 @@ tool_install: true # Set to true to be listed in main selection pag multi_install: false # Set to true if first page of multi-page article, else false multitool_install_part: false # Set to true if a sub-page of a multi-page article, else false layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles +test_maintenance: true +test_images: + - ubuntu:latest --- [Arm Performance Studio](https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Studio%20for%20Mobile) (formally known as `Arm Mobile Studio`) is a performance analysis tool suite for various application developers: @@ -57,7 +60,7 @@ Run the supplied `Arm_Performance_Studio__windows_x86-64.exe` installer ### Linux Unpack the supplied `Arm Performance Studio` bundle to the desired location. For example: -```command +```console tar -xf Arm_Performance_Studio_2024.3_linux_x86-64.tgz ``` ### macOS diff --git a/content/install-guides/ansible.md b/content/install-guides/ansible.md index 38885594d2..7afc03ab21 100644 --- a/content/install-guides/ansible.md +++ b/content/install-guides/ansible.md @@ -8,10 +8,10 @@ minutes_to_complete: 10 multi_install: false multitool_install_part: false official_docs: https://docs.ansible.com/ansible/latest/index.html +test_maintenance: true test_images: - ubuntu:latest test_link: null -test_maintenance: false title: Ansible tool_install: true weight: 1 @@ -19,7 +19,7 @@ weight: 1 Ansible is an open source, command-line automation used to configure systems and deploy software. -Ansible command-line tools can be installed on a variety of Linux distributions. +Ansible command-line tools can be installed on a variety of Linux distributions. [General installation information](https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html) is available which covers all supported operating systems, but it doesn't talk about Arm-based hosts. @@ -41,7 +41,7 @@ aarch64 If you see a different result, you are not using an Arm-based machine running 64-bit Linux. -## How do I download and install Ansible for Ubuntu on Arm? +## How do I download and install Ansible for Ubuntu on Arm? The easiest way to install the latest version of Ansible for Ubuntu on Arm is to use the PPA (Personal Package Archive). @@ -54,7 +54,7 @@ sudo add-apt-repository --yes --update ppa:ansible/ansible sudo apt install ansible -y ``` -Confirm the Ansible command line tools are installed by running: +Confirm the Ansible command line tools are installed by running: ```bash ansible-playbook --version diff --git a/content/install-guides/aperf.md b/content/install-guides/aperf.md index 974cbd17ad..0c037cb095 100644 --- a/content/install-guides/aperf.md +++ b/content/install-guides/aperf.md @@ -7,7 +7,7 @@ multitool_install_part: false official_docs: https://github.com/aws/aperf test_images: - ubuntu:latest -test_maintenance: false +test_maintenance: true title: AWS Perf (APerf) tool_install: true weight: 1 @@ -17,11 +17,11 @@ APerf (AWS Perf) is an open source command line performance analysis tool which APerf was created by AWS to help with Linux performance analysis. -In addition to the CLI, APerf includes an HTML view to visualize the collected data. +In addition to the CLI, APerf includes an HTML view to visualize the collected data. ## Before you begin -APerf works on Linux, and is available as a single binary. +APerf works on Linux, and is available as a single binary. APerf works best if `perf` is installed. Refer to the [Perf for Linux on Arm](/install-guides/perf) install guide for instructions. @@ -43,9 +43,9 @@ If you see a different result, you are not using an Arm computer running 64-bit ## Download and install APerf -The easiest way to install APerf is to download a release from GitHub, extract it, and setup your `PATH` environment variable or copy the executable to a directory already in your search path. +The easiest way to install APerf is to download a release from GitHub, extract it, and setup your `PATH` environment variable or copy the executable to a directory already in your search path. -Visit the [releases page](https://github.com/aws/aperf/releases/) to see a list of available releases. +Visit the [releases page](https://github.com/aws/aperf/releases/) to see a list of available releases. You can also download a release from the command line: @@ -59,7 +59,7 @@ Extract the release: tar xvfz aperf-v0.1.12-alpha-aarch64.tar.gz ``` -Add the path to `aperf` in your `.bashrc` file. +Add the path to `aperf` in your `.bashrc` file. ```console echo 'export PATH="$PATH:$HOME/aperf-v0.1.12-alpha-aarch64"' >> ~/.bashrc @@ -69,12 +69,12 @@ source ~/.bashrc Alternatively, you can copy the `aperf` executable to a directory already in your search path. ```bash { target="ubuntu:latest" } -sudo cp aperf-v0.1.12-alpha-aarch64/aperf /usr/local/bin +sudo cp aperf-v0.1.12-alpha-aarch64/aperf /usr/local/bin ``` Confirm `aperf` is installed by printing the version: -```bash { target="ubuntu:latest" } +```bash { target="ubuntu:latest" } aperf --version ``` @@ -86,33 +86,33 @@ aperf 0.1.0 (4b910d2) ## Verify APerf is working -### Create and view a report +### Create and view a report To confirm APerf is working, start it for 10 seconds and take a sample every 1 second. -```bash { target="ubuntu:latest" } -aperf record -i 1 -p 10 -r run1 --profile +```console +sudo aperf record -i 1 -p 10 -r run1 --profile ``` -After 10 seconds `aperf` completes and you see a directory named `run1` and a tar file named `run1.tar.gz`. +After 10 seconds `aperf` completes and you see a directory named `run1` and a tar file named `run1.tar.gz`. Next, generate a report from the recorded data: -```bash { target="ubuntu:latest" } -aperf report -r run1 -n report1 +```console +sudo aperf report -r run1 -n report1 ``` -The name of the report is `report1` and you will see a `report1` directory and a tar file named `report1.tar.gz`. +The name of the report is `report1` and you will see a `report1` directory and a tar file named `report1.tar.gz`. The tar files are useful if you want to copy them to another machine. Using a web browser, open the file `index.html` in the `report1/` directory. To open the file use `Ctrl+O` for Linux and Windows and use `⌘+O` for macOS. -The report is now visible in the browser. +The report is now visible in the browser. -There are a number of tabs on the left side showing the collected data. +There are a number of tabs on the left side showing the collected data. -You can browse the data and see what has been collected. +You can browse the data and see what has been collected. ![APerf #center](/install-guides/_images/aperf0.png) @@ -124,21 +124,21 @@ The Kernel Config and Sysctl Data tabs are blank unless you click No. To demonstrate comparing 2 runs, create a second run with `aperf record`: -```bash { target="ubuntu:latest" } -aperf record -i 1 -p 10 -r run2 --profile +```console +sudo aperf record -i 1 -p 10 -r run2 --profile ``` -After 10 seconds `aperf` completes and you see a directory named `run2` and a tar file named `run2.tar.gz`. +After 10 seconds `aperf` completes and you see a directory named `run2` and a tar file named `run2.tar.gz`. Generate a report with both the first and second runs included: -```bash { target="ubuntu:latest" } -aperf report -r run1 -r run2 -n compare +```console +sudo aperf report -r run1 -r run2 -n compare ``` -The name of the report is `compare` and you will see a `compare` directory and a tar file named `compare.tar.gz`. +The name of the report is `compare` and you will see a `compare` directory and a tar file named `compare.tar.gz`. -Open the `index.html` file in the `compare/` directory to see the 2 runs side by side. +Open the `index.html` file in the `compare/` directory to see the 2 runs side by side. A screenshot is shown below: diff --git a/content/install-guides/arduino-pico.md b/content/install-guides/arduino-pico.md index 287eca0214..72b0b52f4e 100644 --- a/content/install-guides/arduino-pico.md +++ b/content/install-guides/arduino-pico.md @@ -10,6 +10,7 @@ layout: installtoolsall minutes_to_complete: 15 official_docs: https://docs.aws.amazon.com/greengrass/v2/developerguide/quick-installation.html prerequisites: Arduino IDE +test_maintenance: true test_images: - ubuntu:latest tool_install: true @@ -19,7 +20,7 @@ multitool_install_part: false weight: 1 --- -You can install the Arduino IDE and Arduino core software for the Raspberry Pi Pico and the Raspberry Pi Pico W. +You can install the Arduino IDE and Arduino core software for the Raspberry Pi Pico and the Raspberry Pi Pico W. Arduino core is the software stack that powers Arduino devices and development boards. While the Raspberry Pi Pico isn't an Arduino board, it uses the same RP2040 SoC as the Arduino RP2040 Connect, and therefore can run the same Arduino core software. @@ -27,7 +28,7 @@ Arduino core is the software stack that powers Arduino devices and development b First, you need to install the Arduino IDE on your laptop or desktop. You can download it for your operating system from [the Arduino Software website](https://www.arduino.cc/en/software). Follow the provided instructions for installing the IDE. -Start the IDE by clicking the Arduino IDE icon. +Start the IDE by clicking the Arduino IDE icon. ## Install board support package @@ -43,9 +44,9 @@ When the `Boards Manager` opens search for `pico` and the `Arduino Mbed OS RP204 ### Raspberry Pi Pico W -The `Boards Manager` package for for `Arduino Mbed OS RP2040 Boards` does not include the Raspberry Pi Pico W. +The `Boards Manager` package for for `Arduino Mbed OS RP2040 Boards` does not include the Raspberry Pi Pico W. -If you want to use the Pico W go to `File -> Preferences` (or `Arduino IDE -> Settings` on macOS) and enter the URL below into the `Additional Boards Manager URLs` field: +If you want to use the Pico W go to `File -> Preferences` (or `Arduino IDE -> Settings` on macOS) and enter the URL below into the `Additional Boards Manager URLs` field: ```console https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json @@ -61,9 +62,9 @@ Once the support package is installed, you need to tell the Arduino IDE which su ## Upload to your board -Because the Raspberry Pi Pico doesn't come with the Arduino core software installed, the Arduino IDE won't recognize it. +Because the Raspberry Pi Pico doesn't come with the Arduino core software installed, the Arduino IDE won't recognize it. -To fix that, you must upload a sketch. A sketch is another name for an Arduino software application. +To fix that, you must upload a sketch. A sketch is another name for an Arduino software application. Go to `File -> Examples -> 01.Basics -> Blink` and load the sketch. @@ -75,4 +76,4 @@ You should see the LED on your Raspberry Pi Pico blink on and off every second. If you have trouble uploading a sketch, unplug the board, press and hold the `BOOTSEL` button on the board, plug it in, and then release the button. {{% /notice %}} -You are ready to start writing your own Arduino sketches for Raspberry Pi Pico. \ No newline at end of file +You are ready to start writing your own Arduino sketches for Raspberry Pi Pico. \ No newline at end of file diff --git a/content/install-guides/armds.md b/content/install-guides/armds.md index a202917ff4..7dd427ea09 100644 --- a/content/install-guides/armds.md +++ b/content/install-guides/armds.md @@ -14,6 +14,10 @@ additional_search_terms: ### Estimated completion time in minutes (please use integer multiple of 5) minutes_to_complete: 10 +test_maintenance: true +test_images: + - ubuntu:latest + author_primary: Ronan Synnott ### Link to official documentation @@ -36,7 +40,7 @@ Full host platform requirements are given in the [Getting Started Guide](https:/ ## Download installer packages -The installer will depend on the [edition](https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio#Editions) of Development Studio that you are entitled to. +The installer will depend on the [edition](https://developer.arm.com/Tools%20and%20Software/Arm%20Development%20Studio#Editions) of Development Studio that you are entitled to. The version is denoted by `year.index`, where `index` is a number (for example `2023.1`). You can also generate an Evaluation license from this installation (`Help` > `Arm License Manager`), with capabilities broadly similar to the UBL Gold Edition. diff --git a/content/install-guides/armie.md b/content/install-guides/armie.md index 09bf151f02..ada0e2615d 100644 --- a/content/install-guides/armie.md +++ b/content/install-guides/armie.md @@ -13,7 +13,7 @@ multitool_install_part: false official_docs: https://developer.arm.com/documentation/102190 test_images: - ubuntu:latest -test_maintenance: false +test_maintenance: true title: Arm Instruction Emulator (armie) tool_install: true weight: 1 @@ -21,7 +21,7 @@ weight: 1 [Arm Instruction Emulator](https://developer.arm.com/Tools%20and%20Software/Arm%20Instruction%20Emulator) is a software tool that runs on 64-bit Arm platforms and emulates [Scalable Vector Extension(SVE)](https://developer.arm.com/documentation/102476/latest/instructions). This tool allows you to run your compiled SVE application binaries on hardware that is not SVE-enabled. {{% notice SVE hardware %}} -AWS Graviton 3 and Graviton 4 processors are available and recommended for SVE application development. +AWS Graviton 3 and Graviton 4 processors are available and recommended for SVE application development. {{% /notice %}} ## Before you begin @@ -39,7 +39,7 @@ aarch64 ``` If you see a different result, you are not using an Arm computer running 64-bit Linux. -You must ensure that either [Environment Modules](https://modules.readthedocs.io/en/latest/index.html) or the [Lmod Environment Module System](https://lmod.readthedocs.io/en/latest/) are installed on your Linux machine. The GNU Compiler (GCC) is also required. +You must ensure that either [Environment Modules](https://modules.readthedocs.io/en/latest/index.html) or the [Lmod Environment Module System](https://lmod.readthedocs.io/en/latest/) are installed on your Linux machine. The GNU Compiler (GCC) is also required. For Ubuntu Linux install the required packages. @@ -48,9 +48,9 @@ sudo apt-get install build-essential -y sudo apt-get install environment-modules -y ``` -## Download +## Download -You can download the appropriate Arm Instruction Emulator package for your host Linux platform from [Product Downloads section](https://developer.arm.com/downloads/-/arm-instruction-emulator) of the Arm website. +You can download the appropriate Arm Instruction Emulator package for your host Linux platform from [Product Downloads section](https://developer.arm.com/downloads/-/arm-instruction-emulator) of the Arm website. For Ubuntu Linux download the installer package using `wget` @@ -60,19 +60,18 @@ wget https://developer.arm.com/-/media/Files/downloads/hpc/arm-instruction-emula ## Install -To install the Arm Instruction Emulator, extract the downloaded package and run the install script. +To install the Arm Instruction Emulator, extract the downloaded package and run the install script. -Extract the downloaded package. +Extract the downloaded package. ```bash -tar xf ARM-Instruction-Emulator_22.0_AArch64_Ubuntu_18.04.tar.gz -cd arm-instruction-emulator_22.0_Ubuntu-18.04 +tar -xf ARM-Instruction-Emulator_22.0_AArch64_Ubuntu_18.04.tar.gz ``` Run the install script. ```bash -sudo ./arm-instruction-emulator_22.0_Ubuntu-18.04.sh -a +sudo ./arm-instruction-emulator_22.0_Ubuntu-18.04/arm-instruction-emulator_22.0_Ubuntu-18.04.sh -a ``` Set up the environment for example in your .bashrc and add module files. @@ -85,25 +84,25 @@ source ~/.bashrc To list available modules: -```bash { env_source="~/.bashrc" } +```consple module avail ``` To configure Arm Compiler for Linux: -```bash { env_source="~/.bashrc" } +```console module load armie22/22.0 ``` To confirm `armie` is installed, print the version. -```bash { env_source="~/.bashrc" } +```console armie --version ``` ## Setting up product license -Arm Instruction Emulator does not require a license. +Arm Instruction Emulator does not require a license. ## Get started diff --git a/content/install-guides/armpl.md b/content/install-guides/armpl.md index 7dcb2a42e1..7643be2424 100644 --- a/content/install-guides/armpl.md +++ b/content/install-guides/armpl.md @@ -14,6 +14,10 @@ additional_search_terms: ### Estimated completion time in minutes (please use integer multiple of 5) minutes_to_complete: 10 +test_maintenance: true +test_images: + - ubuntu:latest + ### Link to official documentation official_docs: https://developer.arm.com/documentation/101004 author_primary: Pareena Verma @@ -115,21 +119,20 @@ The instructions shown below are for deb based installers for GCC users. In a terminal, run the command shown below to download the debian package: -```console +```bash wget https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/24-04/linux/arm-performance-libraries_24.04_deb_gcc.tar ``` Use `tar` to extract the file and then change directory: -```console +```bash tar -xf arm-performance-libraries_24.04_deb_gcc.tar -cd arm-performance-libraries_24.04_deb/ ``` Run the installation script as a super user: -```console -sudo ./arm-performance-libraries_24.04_deb.sh --accept +```bash +sudo ./arm-performance-libraries_24.04_deb/arm-performance-libraries_24.04_deb.sh --accept ``` Using the `--accept` switch you automatically accept the End User License Agreement and the packages are installed to the `/opt/arm` directory. diff --git a/content/install-guides/aws-cli.md b/content/install-guides/aws-cli.md index c37fd37736..1638a1680e 100644 --- a/content/install-guides/aws-cli.md +++ b/content/install-guides/aws-cli.md @@ -12,18 +12,15 @@ multitool_install_part: false official_docs: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html test_images: - ubuntu:latest -test_link: null -test_maintenance: false -test_status: -- passed +test_maintenance: true title: AWS CLI tool_install: true weight: 1 --- -[AWS CLI](https://docs.aws.amazon.com/cli/index.html) is a cross-platform command-line tool that can be installed on development computers. The AWS Command Line Interface (AWS CLI) is a unified tool that provides a consistent interface for interacting with all parts of Amazon Web Services. +[AWS CLI](https://docs.aws.amazon.com/cli/index.html) is a cross-platform command-line tool that can be installed on development computers. The AWS Command Line Interface (AWS CLI) is a unified tool that provides a consistent interface for interacting with all parts of Amazon Web Services. -It is available for a variety of operating systems and Linux distributions, supports the Arm architecture and has multiple ways to install it. +It is available for a variety of operating systems and Linux distributions, supports the Arm architecture and has multiple ways to install it. ## What should I do before installing AWS CLI? @@ -54,7 +51,7 @@ sudo apt update sudo apt install unzip -y ``` -Download the zip file with `curl`, extract the installer, and run it. +Download the zip file with `curl`, extract the installer, and run it. ```bash { target="ubuntu:latest" } curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" @@ -68,6 +65,6 @@ Confirm the CLI version 2 is available by invoking the `aws` command to print th aws --version ``` -Review [AWS CLI v2 is now generally available](https://aws.amazon.com/blogs/developer/aws-cli-v2-is-now-generally-available/) to review the new features in version 2. +Review [AWS CLI v2 is now generally available](https://aws.amazon.com/blogs/developer/aws-cli-v2-is-now-generally-available/) to review the new features in version 2. You now have the latest version of the AWS CLI installed. Follow [this guide](/install-guides/aws_access_keys/) to generate and configure access keys needed to use the AWS CLI. diff --git a/content/install-guides/aws-copilot.md b/content/install-guides/aws-copilot.md index 0345bf04ef..8680f0ed03 100644 --- a/content/install-guides/aws-copilot.md +++ b/content/install-guides/aws-copilot.md @@ -12,10 +12,7 @@ multitool_install_part: false official_docs: https://aws.github.io/copilot-cli/ test_images: - ubuntu:latest -test_link: null -test_maintenance: false -test_status: -- passed +test_maintenance: true title: AWS Copilot CLI tool_install: true weight: 1 @@ -23,7 +20,7 @@ weight: 1 AWS Copilot CLI is an open source command line interface for running containers on AWS App Runner, Amazon Elastic Container Service (ECS), and AWS Fargate. -It is available for a variety of operating systems and Linux distributions and supports the Arm architecture. +It is available for a variety of operating systems and Linux distributions and supports the Arm architecture. ## Before you begin @@ -49,7 +46,7 @@ arm64 ## Download and install AWS Copilot CLI -Copilot requires Docker. Refer to the [Docker](/install-guides/docker/) install guide for installation instructions. +Copilot requires Docker. Refer to the [Docker](/install-guides/docker/) install guide for installation instructions. If you are using Docker on Linux you will need to install QEMU to build container images for both the `arm64` and the `amd64` architectures. diff --git a/content/install-guides/aws-greengrass-v2.md b/content/install-guides/aws-greengrass-v2.md index 370ea75604..2d49679759 100644 --- a/content/install-guides/aws-greengrass-v2.md +++ b/content/install-guides/aws-greengrass-v2.md @@ -10,6 +10,7 @@ layout: installtoolsall minutes_to_complete: 15 official_docs: https://docs.aws.amazon.com/greengrass/v2/developerguide/quick-installation.html prerequisites: AWS Account with IAM use role +test_maintenance: false test_images: - ubuntu:latest tool_install: true @@ -31,7 +32,7 @@ The instructions provide the fastest and simplest configuration for deploying AW Before installing AWS IoT Greengrass on your device you first need to create an AWS IAM role with sufficient permissions to create Greengrass Things, Groups, and Roles. -You will also create and save an access key and secret access key for AWS CLI access. +You will also create and save an access key and secret access key for AWS CLI access. ### Before you begin @@ -110,13 +111,13 @@ Log in to the AWS console, set the AWS region you want to use in upper right cor 5. Replace `account-id` on lines 16 and 17 with your AWS account ID -You can find your account ID by clicking on your user name in the top-right corner of the AWS console. +You can find your account ID by clicking on your user name in the top-right corner of the AWS console. ![Role Permissions Editor #center](/install-guides/_images/gg-role-permissions.png) 6. Name the new policy `GGDeploymentAccess` -7. Back on the group creation page, click the refresh button then search for and select `GGDeploymentAccess` +7. Back on the group creation page, click the refresh button then search for and select `GGDeploymentAccess` ![Group Policy Selection #center](/install-guides/_images/gg-group-policy.png) @@ -130,11 +131,11 @@ You can find your account ID by clicking on your user name in the top-right corn 12. Select `Command Line Interface (CLI)` for your key type, ignoring the warnings for now (you should delete they keys when you're done testing). -13. Copy your `Access key` and `Secret access key`. +13. Copy your `Access key` and `Secret access key`. ![Access Keys #center](/install-guides/_images/gg-access-keys.png) -You will use the credentials in the next section. +You will use the credentials in the next section. ## Download and install AWS IoT Greengrass @@ -160,7 +161,7 @@ export AWS_REGION="us-east-1" Replace `us-east-1` with the AWS region you want to use. {{% /notice %}} -Download the zip file with `curl`, extract the installer, and run it. +Download the zip file with `curl`, extract the installer, and run it. This will install the AWS IoT Greengrass v2 software on your device, and and register the device with the Greengrass service. @@ -204,12 +205,12 @@ systemctl status greengrass ## View your device in the AWS console -In your browser, go to the AWS console and navigate to the IoT Greengrass console. +In your browser, go to the AWS console and navigate to the IoT Greengrass console. You will see the new device listed in the Greengrass core devices. -Click on the device name to see more device details. +Click on the device name to see more device details. ![Greengrass Devices #center](/install-guides/_images/greengrass-devices.png) -You are now ready to use AWS IoT Greengrass v2 on your device. \ No newline at end of file +You are now ready to use AWS IoT Greengrass v2 on your device. \ No newline at end of file diff --git a/content/install-guides/azure-cli.md b/content/install-guides/azure-cli.md index 64ece50ec6..24bf7057c0 100644 --- a/content/install-guides/azure-cli.md +++ b/content/install-guides/azure-cli.md @@ -10,7 +10,6 @@ multitool_install_part: false official_docs: https://learn.microsoft.com/en-us/cli/azure test_images: - ubuntu:latest -test_link: null test_maintenance: true test_status: - passed @@ -19,9 +18,9 @@ tool_install: true weight: 1 --- -[Azure CLI](https://learn.microsoft.com/en-us/cli/azure/) is a cross-platform command-line tool that can be installed locally on development computers. Azure CLI is used to connect to Azure and execute administrative commands on Azure resources. +[Azure CLI](https://learn.microsoft.com/en-us/cli/azure/) is a cross-platform command-line tool that can be installed locally on development computers. Azure CLI is used to connect to Azure and execute administrative commands on Azure resources. -It is available for a variety of operating systems and Linux distributions and has multiple ways to install it. +It is available for a variety of operating systems and Linux distributions and has multiple ways to install it. ## Before you begin @@ -74,17 +73,20 @@ If you prefer installing the Azure CLI using Python3, follow the instructions be ## Download and Install using pip -Another way to install Azure CLI for Ubuntu on Arm is to use Python pip. +Another way to install Azure CLI for Ubuntu on Arm is to use Python pip. -Install Python pip. +Install Python pip and create a virtual environment. -```bash { target="ubuntu:latest" } -sudo apt install python3-pip python-is-python3 -y +```bash +sudo apt update +sudo apt install python3-pip python-is-python3 python3-venv -y +python -m venv azure-cli-venv ``` -Download and install Azure CLI. +Activate it and install Azure CLI. -```bash { target="ubuntu:latest" } +```bash +source azure-cli-venv/bin/activate pip install azure-cli ``` diff --git a/content/install-guides/bolt.md b/content/install-guides/bolt.md index 148df9bd2b..958e8aca2f 100644 --- a/content/install-guides/bolt.md +++ b/content/install-guides/bolt.md @@ -14,7 +14,7 @@ official_docs: https://github.com/llvm/llvm-project/tree/main/bolt test_images: - ubuntu:latest -test_maintenance: false +test_maintenance: true layout: installtoolsall tool_install: true @@ -33,7 +33,7 @@ This article provides quick instructions to download and install BOLT. The instr [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) using the documentation for your operating system. -Many Linux distributions include Git so you may not need to install it. +Many Linux distributions include Git so you may not need to install it. 2. Install CMake @@ -96,26 +96,35 @@ Thread model: posix InstalledDir: /usr/bin ``` +5. Install xz-utils + +```bash +sudo apt-get install xz-utils -y +``` + ## Install BOLT -You can install BOLT in 2 different ways, by building the source code or by downloading a binary release from GitHub. +You can install BOLT in 2 different ways, by building the source code or by downloading a binary release from GitHub. ### Option 1: Download, build, and install BOLT from source code 1. Clone the repository -```console +```bash cd $HOME git clone https://github.com/llvm/llvm-project.git ``` -2. Build BOLT +2. Build BOLT and run it. -```console +```bash cd llvm-project mkdir build cd build -cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt" +cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;clang;lld" +``` + +```console ninja bolt ``` @@ -123,12 +132,12 @@ Build time depends on your machine configuration, and it may take several minute 3. Add the path to BOLT in your `.bashrc` file -```console +```bash echo 'export PATH="$PATH:$HOME/llvm-project/build/bin"' >> ~/.bashrc source ~/.bashrc ``` -You are now ready to [verify BOLT is installed](#verify). +You are now ready to [verify BOLT is installed](#verify). ### Option 2: Download and install BOLT using a binary release @@ -136,20 +145,20 @@ You are now ready to [verify BOLT is installed](#verify). For Arm Linux use the file with `aarch64` in the name: -```bash { target="ubuntu:latest" } +```bash cd $HOME wget https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.5/clang+llvm-17.0.5-aarch64-linux-gnu.tar.xz ``` 2. Extract the downloaded file -```bash { target="ubuntu:latest" } -tar xvf clang+llvm-17.0.5-aarch64-linux-gnu.tar.xz +```bash +tar -xvf clang+llvm-17.0.5-aarch64-linux-gnu.tar.xz ``` 3. Add the path to BOLT in your `.bashrc` file -```bash { target="ubuntu:latest" } +```bash echo 'export PATH="$PATH:$HOME/clang+llvm-17.0.5-aarch64-linux-gnu/bin"' >> ~/.bashrc source ~/.bashrc ``` @@ -160,7 +169,7 @@ source ~/.bashrc Check the `perf2bolt` command: -```bash { target="ubuntu:latest" } +```console perf2bolt ``` @@ -173,7 +182,7 @@ Must specify at least 1 positional argument: See: perf2bolt --help Check the `llvm-bolt` command: -```bash { target="ubuntu:latest" } +```console llvm-bolt ``` @@ -186,7 +195,7 @@ Must specify at least 1 positional argument: See: llvm-bolt --help 2. Print the BOLT version -```bash { target="ubuntu:latest" } +```console llvm-bolt --version ``` @@ -208,6 +217,6 @@ BOLT revision 99c15eb49ba0b607314b3bd221f0760049130d97 x86-64 - 64-bit X86: EM64T and AMD64 ``` -You will see additional Registered Targets if you downloaded a binary release. +You will see additional Registered Targets if you downloaded a binary release. You are ready to use BOLT on your Linux machine. diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index 1f216e0efb..c97a191f07 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -20,19 +20,67 @@ sw_categories: tests_and_status: - ubuntu:latest: passed - fedora:latest: passed + ambaviz: + readable_title: Arm AMBA Viz + tests_and_status: + - ubuntu:latest: passed + ams: + readable_title: Arm Performance Studio + tests_and_status: + - ubuntu:latest: passed anaconda: readable_title: Anaconda tests_and_status: - ubuntu:latest: passed + ansible: + readable_title: Ansible + tests_and_status: + - ubuntu:latest: passed + aperf: + readable_title: AWS Perf (APerf) + tests_and_status: + - ubuntu:latest: passed + arduino-pico: + readable_title: Arduino core for the Raspberry Pi Pico + tests_and_status: + - ubuntu:latest: passed arm-gnu: readable_title: Arm GNU Toolchain tests_and_status: - ubuntu:latest: passed - fedora:latest: passed + armclang: + readable_title: Arm Compiler for Embedded + tests_and_status: + - ubuntu:latest: passed + armds: + readable_title: Arm Development Studio + tests_and_status: + - ubuntu:latest: passed + armie: + readable_title: Arm Instruction Emulator + tests_and_status: + - ubuntu:latest: passed + armpl: + readable_title: Arm Performance Libraries + tests_and_status: + - ubuntu:latest: passed + aws-cli: + readable_title: AWS CLI + tests_and_status: + - ubuntu:latest: passed + aws-copilot: + readable_title: AWS CLI + tests_and_status: + - ubuntu:latest: passed azure-cli: readable_title: Azure CLI tests_and_status: - ubuntu:latest: passed + bolt: + readable_title: BOLT + tests_and_status: + - ubuntu:latest: passed cross: readable_title: Cross-compiler tests_and_status: diff --git a/tools/check.py b/tools/check.py index f658997ff1..7318db5893 100644 --- a/tools/check.py +++ b/tools/check.py @@ -264,7 +264,6 @@ def check(json_file, start, stop, md_article): logging.debug(f"{process_output}") logging.info(f"{msg}") logging.info("---------") - result = "failed" if results[test_images[n_image]] else "passed" logging.info(f"Tests {result} on {test_image}") From 73cd1b7e0a20f6480c41c94100de8a9d9849bae7 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 09:30:18 +0100 Subject: [PATCH 023/185] Call bash explicitly --- content/install-guides/armie.md | 2 +- tools/check.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/armie.md b/content/install-guides/armie.md index ada0e2615d..3ea15b3642 100644 --- a/content/install-guides/armie.md +++ b/content/install-guides/armie.md @@ -84,7 +84,7 @@ source ~/.bashrc To list available modules: -```consple +```console module avail ``` diff --git a/tools/check.py b/tools/check.py index 7318db5893..4e4a63e77c 100644 --- a/tools/check.py +++ b/tools/check.py @@ -187,7 +187,7 @@ def check(json_file, start, stop, md_article): subprocess.run(run_command, shell=True, capture_output=True) logging.debug(run_command) # execute file as is with bash - run_command = [f"./{test_cmd_filename}"] + run_command = [f"bash ./{test_cmd_filename}"] elif test_type == "fvp": # Start instance for image if start: From 2271b0ea35880f0228fe3b0224fa232a5d85013e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 10:21:56 +0100 Subject: [PATCH 024/185] Update bolt.md and aws-cli.md --- content/install-guides/aws-cli.md | 2 +- content/install-guides/bolt.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/content/install-guides/aws-cli.md b/content/install-guides/aws-cli.md index 1638a1680e..763cf3b798 100644 --- a/content/install-guides/aws-cli.md +++ b/content/install-guides/aws-cli.md @@ -56,7 +56,7 @@ Download the zip file with `curl`, extract the installer, and run it. ```bash { target="ubuntu:latest" } curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" unzip awscliv2.zip -sudo ./aws/install +sudo ./aws/install --update ``` Confirm the CLI version 2 is available by invoking the `aws` command to print the version. diff --git a/content/install-guides/bolt.md b/content/install-guides/bolt.md index 958e8aca2f..47acc51346 100644 --- a/content/install-guides/bolt.md +++ b/content/install-guides/bolt.md @@ -111,7 +111,6 @@ You can install BOLT in 2 different ways, by building the source code or by down 1. Clone the repository ```bash -cd $HOME git clone https://github.com/llvm/llvm-project.git ``` @@ -146,7 +145,6 @@ You are now ready to [verify BOLT is installed](#verify). For Arm Linux use the file with `aarch64` in the name: ```bash -cd $HOME wget https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.5/clang+llvm-17.0.5-aarch64-linux-gnu.tar.xz ``` From 252f397e32f50f0bbbb574518795d7faf52fef71 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 13:10:35 +0100 Subject: [PATCH 025/185] Add Linux-based install guides - Remove files that are generated for easier local testing --- content/install-guides/gcloud.md | 12 +++--- content/install-guides/multipass.md | 62 +++++++++++++++-------------- content/install-guides/papi.md | 7 ++-- content/install-guides/perf.md | 60 +++++++++++++++------------- content/install-guides/pulumi.md | 38 +++++++++--------- content/install-guides/pytorch.md | 40 +++++++++---------- tools/check.py | 10 +++++ 7 files changed, 124 insertions(+), 105 deletions(-) diff --git a/content/install-guides/gcloud.md b/content/install-guides/gcloud.md index 5e93110f0a..5ed6ae3c32 100644 --- a/content/install-guides/gcloud.md +++ b/content/install-guides/gcloud.md @@ -1,5 +1,5 @@ --- -additional_search_terms: +additional_search_terms: - cloud - google cloud - google @@ -14,19 +14,19 @@ multitool_install_part: false official_docs: https://cloud.google.com/sdk/docs/install-sdk test_images: - ubuntu:latest -test_maintenance: false -title: Google Cloud Platform (GCP) CLI +test_maintenance: true +title: Google Cloud Platform (GCP) CLI tool_install: true weight: 1 --- The Google Cloud CLI, `gcloud`, allows you to run commands in your Google Cloud account. -`gcloud` is available for Windows, macOS, Linux and supports the Arm architecture. +`gcloud` is available for Windows, macOS, Linux and supports the Arm architecture. ## What should I consider before installing gcloud? -Use the documentation link to find alternative installation options. +Use the documentation link to find alternative installation options. This article provides a quick solution to install `gcloud` for Ubuntu on Arm. @@ -54,7 +54,7 @@ Download and install the required software packages. sudo apt-get install -y curl apt-transport-https ca-certificates gnupg ``` -Install `gcloud` from the Google repository. +Install `gcloud` from the Google repository. ```bash { target="ubuntu:latest" } echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index b336cf38a4..a41f7af9a8 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -21,6 +21,10 @@ author_primary: Jason Andrews ### Link to official documentation official_docs: https://multipass.run/docs +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -32,15 +36,15 @@ layout: installtoolsall # DO NOT MODIFY. Always true for tool install ar A computer running macOS with Apple Silicon or an Arm Linux computer with KVM enabled is required to complete the installation. {{% /notice %}} -[Multipass](https://multipass.run/) provides cloud style virtual machines (VMs). Multipass is popular among developers for efficient, local testing. When run on macOS with Apple Silicon or on Linux with a Raspberry Pi 5, Multipass provides a similar experience to cloud instances. A local, software compatible equivalent of an Arm cloud instance on your desk with good performance is an important option for developers. +[Multipass](https://multipass.run/) provides cloud style virtual machines (VMs). Multipass is popular among developers for efficient, local testing. When run on macOS with Apple Silicon or on Linux with a Raspberry Pi 5, Multipass provides a similar experience to cloud instances. A local, software compatible equivalent of an Arm cloud instance on your desk with good performance is an important option for developers. Multipass provides a clear CLI to easily start virtual machine instances, do development tasks, and clean the VMs from your computer. ## Before you begin -Multipass runs on a variety of platforms and host operating systems. The information below covers running Multipass on macOS with Apple Silicon and Arm Linux with the goal of creating a compatible Ubuntu Linux environment for developers working on cloud instances. +Multipass runs on a variety of platforms and host operating systems. The information below covers running Multipass on macOS with Apple Silicon and Arm Linux with the goal of creating a compatible Ubuntu Linux environment for developers working on cloud instances. -Multipass uses the terms virtual machine and instance synonymously. +Multipass uses the terms virtual machine and instance synonymously. ## Installation on macOS @@ -48,7 +52,7 @@ Multipass uses the terms virtual machine and instance synonymously. Download Multipass for macOS. -```console +```bash wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg ``` @@ -56,19 +60,19 @@ wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multip Install the download using the package command. -```console +```bash sudo installer -pkg multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg -target / ``` -The getting started instructions below use the command line interface. If you prefer to use the graphical interface start it from the macOS Launchpad, the initial screen is shown below. You can use the UI to create, start, and stop virtual machines. +The getting started instructions below use the command line interface. If you prefer to use the graphical interface start it from the macOS Launchpad, the initial screen is shown below. You can use the UI to create, start, and stop virtual machines. ![Connect #center](/install-guides/_images/multipass-gui.png) Multipass is now installed. Proceed to [Get Started with Multipass](#getstarted). -## Installation on Arm Linux +## Installation on Arm Linux -Multipass can be used on Arm Linux computers such as the Raspberry Pi 5. +Multipass can be used on Arm Linux computers such as the Raspberry Pi 5. Running Multipass on Linux requires the KVM hypervisor. KVM does not typically work on virtual machines, it requires bare metal. @@ -80,13 +84,13 @@ Install and run the `kvm-ok` command to confirm KVM is available. Install `kvm-ok` on Debian based Linux distributions using: -```console +```bash sudo apt install cpu-checker -y ``` To check if KVM is available run: -```console +```bash kvm-ok ``` @@ -106,11 +110,11 @@ INFO: For more detailed results, you should run this as root HINT: sudo /usr/sbin/kvm-ok ``` -If KVM is available, proceed with the install. +If KVM is available, proceed with the install. -### Install +### Install -You may need to install the Snap daemon, `snapd`, before installing Multipass. +You may need to install the Snap daemon, `snapd`, before installing Multipass. If you are not sure if it is running, execute the command: @@ -118,26 +122,26 @@ If you are not sure if it is running, execute the command: snap version ``` -If the command is found and version information is printed, then `snapd` is running. +If the command is found and version information is printed, then `snapd` is running. If you need to install `snapd` run: -```console +```bash sudo apt install snapd -y ``` LXD is also required for Multipass. -```console +```bash sudo snap install lxd ``` {{% notice Note %}} -You can select from three Multipass releases: stable, beta, or edge. The default version is stable. +You can select from three Multipass releases: stable, beta, or edge. The default version is stable. Add `--beta` or `--edge` to the install command below to select these more recent versions. {{% /notice %}} -```console +```bash sudo snap install multipass ``` @@ -147,13 +151,13 @@ Multipass is now installed. To confirm multipass is installed run the `version` command. -```console +```bash multipass version ``` If the `multipass` command is not found, you can add `/snap/bin` to the Bash search path using: -```console +```bash export PATH=$PATH:/snap/bin ``` @@ -161,8 +165,8 @@ Multipass runs Ubuntu images. The last three LTS (long-term support) versions ar To see the available images run the `find` command. Any of the listed images can be used to create a new instance. -```console -multipass find +```bash +multipass find ``` The output from `find` will be similar to the below. @@ -185,9 +189,9 @@ ros2-humble 0.1 A development and ### Launching instances -The default values for launching instances allocate 1 CPU, create a small disk (5 Gb), and limited memory (1 Gb). By default, the name of the instance is automatically assigned. +The default values for launching instances allocate 1 CPU, create a small disk (5 Gb), and limited memory (1 Gb). By default, the name of the instance is automatically assigned. -Most developers are likely to want to modify the defaults. +Most developers are likely to want to modify the defaults. Use the command below to launch a virtual machine instance with non-default values. @@ -257,7 +261,7 @@ For example, to mount a host directory called `dev` and have it appear in the in multipass mount dev m1u:/home/ubuntu/dev ``` -There are also options to adjust the user and group IDs as needed to avoid permission problems. +There are also options to adjust the user and group IDs as needed to avoid permission problems. Use the `umount` command to unmount the directory. @@ -269,7 +273,7 @@ Directories can be dynamically mounted and unmounted without stopping the instan ### Stop and Start -Multipass instances can be stopped and started quickly. +Multipass instances can be stopped and started quickly. To stop the instance. @@ -287,9 +291,9 @@ multipass start m1u ### Cleanup -Multipass instances are easy to delete. There is one extra level of protection to recover deleted instances before they are fully deleted. +Multipass instances are easy to delete. There is one extra level of protection to recover deleted instances before they are fully deleted. -Use the `delete` command to delete. +Use the `delete` command to delete. ```console multipass delete m1u @@ -302,7 +306,7 @@ multipass recover m1u Use the `purge` command to permanently remove all deleted instances. ```console -multipass purge +multipass purge ``` {{% notice Note %}} Purged instances are no longer recoverable. diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 4ef68f94d2..b9ea8d6c2e 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -8,6 +8,7 @@ additional_search_terms: test_images: - ubuntu:latest +test_maintenance: true ### FIXED, DO NOT MODIFY weight: 1 # Defines page ordering. Must be 1 for first (or only) page. @@ -19,7 +20,7 @@ layout: installtoolsall # DO NOT MODIFY. Always true for tool install ar Performance Application Programming Interface (PAPI) provides a consistent library of functions for accessing performance counters from an application. -You can use PAPI in your source code to access performance counters and profile specific sections of your application. +You can use PAPI in your source code to access performance counters and profile specific sections of your application. PAPI is available as source code on GitHub. @@ -43,7 +44,7 @@ If you see a different result, you are not using an Arm computer running 64-bit You need `gcc` and `make` to build PAPI. -Use the Linux package manager to install the required software packages on your Linux distribution. +Use the Linux package manager to install the required software packages on your Linux distribution. For Debian based distributions (including Ubuntu) run: @@ -75,7 +76,7 @@ sudo make install 4. Copy the test program below and paste it into a text file named `papi-test.c``: -```C +```C { file_name="papi-test.c" } #include #include #include diff --git a/content/install-guides/perf.md b/content/install-guides/perf.md index 3e516e0e8d..30cf789216 100644 --- a/content/install-guides/perf.md +++ b/content/install-guides/perf.md @@ -19,6 +19,10 @@ author_primary: Jason Andrews ### Link to official documentation official_docs: https://perf.wiki.kernel.org/index.php/Main_Page +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -31,7 +35,7 @@ Linux Perf is a command line performance analysis tool. The source code is part Perf can be used on a wide variety of Arm Linux systems including laptops, desktops, cloud virtual machines, Windows on Arm with WSL (Windows Subsystem for Linux), and ChromeOS with Linux enabled. -Perf is best installed using a Linux package manager, but if a suitable package is not available you can build it from source code. Both situations are covered below. +Perf is best installed using a Linux package manager, but if a suitable package is not available you can build it from source code. Both situations are covered below. ## Before you begin @@ -39,7 +43,7 @@ Follow the instructions below to install Perf on an Arm Linux system. Confirm you are using an Arm machine by running: -```console +```bash uname -m ``` @@ -55,11 +59,11 @@ Perf is dependent on the version of the Linux kernel. To find your version run: -```console +```bash uname -r ``` -The output will be a string with the first two numbers providing the major and minor kernel version numbers. +The output will be a string with the first two numbers providing the major and minor kernel version numbers. For example: @@ -67,13 +71,13 @@ For example: 5.15.0-79-generic ``` -This indicates kernel version 5.15. +This indicates kernel version 5.15. ## Install Perf -The Perf source code is part of the Linux kernel source tree. +The Perf source code is part of the Linux kernel source tree. -There are two ways to install Perf on Arm Linux machines: +There are two ways to install Perf on Arm Linux machines: - Use a [Linux package manager](#packman) - Build the [source code](#source) @@ -85,7 +89,7 @@ Use the tabs below and copy the commands for your Linux package manager: {{< tabpane code=true >}} {{< tab header="Ubuntu" language="bash">}} -sudo apt update && sudo apt install linux-tools-generic linux-tools-$(uname -r) -y +sudo apt update && sudo apt install linux-tools-generic linux-tools-$(uname -r) -y {{< /tab >}} {{< tab header="Debian/Raspberry Pi OS" language="bash">}} sudo apt install linux-perf -y @@ -95,9 +99,9 @@ sudo dnf install perf -y {{< /tab >}} {{< /tabpane >}} -If the package manager completes successfully you can skip the next section and proceed to [test](#test) Perf. +If the package manager completes successfully you can skip the next section and proceed to [test](#test) Perf. -If the package manager does not complete successfully, it usually means there was no package available for your specific kernel version as shown by `uname -r`. +If the package manager does not complete successfully, it usually means there was no package available for your specific kernel version as shown by `uname -r`. There are hundreds of packages, and the package name must match the output of `uname -r` exactly. This is most common on Arm single board computers (SBCs) where the Linux kernel has been customized. @@ -105,13 +109,13 @@ If there is no match, you can install Perf using the source code as described in ### Build the source code {#source} -If there is no package available for your kernel version you can build Perf from source code. +If there is no package available for your kernel version you can build Perf from source code. -Building Perf from source requires `gcc`, `flex`, `bison`, `git`, and `make`. Install these on your system. +Building Perf from source requires `gcc`, `flex`, `bison`, `git`, and `make`. Install these on your system. For Debian and Ubuntu run: -```console +```bash sudo apt install gcc flex bison make git -y ``` @@ -119,13 +123,13 @@ Use `git` to get the source code. Use `--branch` to specify the Linux kernel sou For example, if your kernel version is 5.15, use: -```console +```bash git clone --depth=1 --branch v5.15 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git ``` Change to the `linux` directory and build: -```console +```bash cd linux make -C tools/perf ``` @@ -136,7 +140,7 @@ You can copy it to a location in your search path or run it from the current loc To copy it use: -```console +```bash sudo cp tools/perf/perf /usr/local/bin ``` @@ -144,7 +148,7 @@ sudo cp tools/perf/perf /usr/local/bin Regardless of how you installed Perf, run the `version` command: -```console +```bash perf version ``` @@ -156,7 +160,7 @@ perf version 5.15.116 You can also try the `list` command to confirm `perf` is working as expected: -```console +```bash perf list ``` @@ -219,7 +223,7 @@ E: linux-perf-5.15 is not installed. ### Generate a test Perf report Generate a simple Perf report. For example: -```command +```bash perf stat -a pwd ``` The `pwd` command output will be shown as well as the report: @@ -262,9 +266,9 @@ Typically the value must be 2 or less to collect Perf metrics. To set this until the next reboot, run the following command: -```console +```bash sudo sysctl -w kernel.perf_event_paranoid=2 -`````` +``` To permanently set the paranoid level, add the following line to the file `/etc/sysctl.conf` @@ -274,13 +278,13 @@ kernel.perf_event_paranoid=2 ### Additional Perf commands -There are five common commands used in performance analysis. +There are five common commands used in performance analysis. * **stat** provides performance counter statistics for the overall execution of a program * **record** samples the program and records the samples into a data file (perf.data by default) -* **report** generates a report of where the samples occurred +* **report** generates a report of where the samples occurred * **annotate** displays the annotated code showing the source and assembly code for the samples @@ -288,7 +292,7 @@ There are five common commands used in performance analysis. Arm systems use a kernel driver to expose PMU hardware counters. The driver needs to be enabled in the Linux kernel in order to collect the hardware events. -To check if the driver is running use the `dmesg` command: +To check if the driver is running use the `dmesg` command: ```bash dmesg | grep "PMU driver" @@ -298,7 +302,7 @@ dmesg | grep "PMU driver" Depending on your system, you might need to use `sudo` to run the `dmesg` command. {{% /notice %}} -If you see output similar to the message below, the Arm PMU driver is installed. +If you see output similar to the message below, the Arm PMU driver is installed. ```output [ 0.046063] hw perfevents: enabled with armv8_pmuv3_0 PMU driver, 3 counters available @@ -306,9 +310,9 @@ If you see output similar to the message below, the Arm PMU driver is installed. The number of counters available could be between 1 and 7 depending on processor types and virtualization. -If you see multiple instances of the PMU driver, it means the hardware is a [big.LITTLE](https://www.arm.com/en/technologies/big-little) system with different processors, each has it's own PMU. +If you see multiple instances of the PMU driver, it means the hardware is a [big.LITTLE](https://www.arm.com/en/technologies/big-little) system with different processors, each has it's own PMU. -If the message is not in the kernel message log, check both the PMU driver device tree entry and the kernel configuration parameters listed above. +If the message is not in the kernel message log, check both the PMU driver device tree entry and the kernel configuration parameters listed above. The important kernel parameters are: @@ -320,4 +324,4 @@ CONFIG_ARM_PMU=y CONFIG_HW_PERF_EVENTS=y ``` -You are now ready to use Perf on your Arm Linux system. +You are now ready to use Perf on your Arm Linux system. diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index 55c4e5d4a0..61f58389ef 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -56,14 +56,14 @@ source $HOME/.bashrc Confirm `pulumi` is now in the search path: -```bash { env_source="~/.bashrc" output_lines = "2"} +```bash { env_source="~/.bashrc" | "2"} which pulumi /home/ubuntu/.pulumi/bin/pulumi ``` Print the version: -```bash { env_source="~/.bashrc" output_lines = "2"} +```bash { env_source="~/.bashrc" | "2"} pulumi version v3.78.0 ``` @@ -72,17 +72,17 @@ You are ready to use Pulumi on your Linux machine. ## Get started {#start} -Pulumi keeps your projects and state information in Pulumi Cloud, making it easy to access them from anywhere. If you want to use Pulumi Cloud visit [app.pulumi.com](https://app.pulumi.com/) and sign up. +Pulumi keeps your projects and state information in Pulumi Cloud, making it easy to access them from anywhere. If you want to use Pulumi Cloud visit [app.pulumi.com](https://app.pulumi.com/) and sign up. -It's not necessary to use Pulumi Cloud to get started, you can store project information on your local computer. +It's not necessary to use Pulumi Cloud to get started, you can store project information on your local computer. Below is a simple example to try out Pulumi. -The example demonstrates using Docker to pull a container image from Docker Hub to your local machine using Python. +The example demonstrates using Docker to pull a container image from Docker Hub to your local machine using Python. -To run the example, you need to install Docker. Refer to the [Docker install guide](/install-guides/docker/) for instructions. +To run the example, you need to install Docker. Refer to the [Docker install guide](/install-guides/docker/) for instructions. -You also need Python. Make sure you have `python` and `pip` installed. +You also need Python. Make sure you have `python` and `pip` installed. For `Ubuntu 22.04` on Arm you can run the commands below to install: @@ -97,7 +97,7 @@ Create a new directory for the example: mkdir pulumi-test ; cd pulumi-test ``` -Log in to your local machine, a shortcut to use `~/.pulumi` to store project data. +Log in to your local machine, a shortcut to use `~/.pulumi` to store project data. ```bash { env_source="~/.bashrc" } pulumi login --local @@ -154,9 +154,9 @@ There are 4 prompts to respond to: 2. Enter a name for the stack. -3. When prompted, enter a passphrase for the stack (twice). +3. When prompted, enter a passphrase for the stack (twice). -4. Answer `yes` to the final question to create the stack. +4. Answer `yes` to the final question to create the stack. An example output for `pulumi up` is shown below: @@ -164,12 +164,12 @@ An example output for `pulumi up` is shown below: Please choose a stack, or create a new one: [Use arrows to move, type to filterPlease choose a stack, or create a new one: Please enter your desired stack name: test1 Created stack 'test1' -Enter your passphrase to protect config/secrets: -Re-enter your passphrase to confirm: +Enter your passphrase to protect config/secrets: +Re-enter your passphrase to confirm: Previewing update (test1): - Type Name Plan - + pulumi:pulumi:Stack alpine-pull-test1 create - + └─ docker:index:RemoteImage alpineImage create + Type Name Plan + + pulumi:pulumi:Stack alpine-pull-test1 create + + └─ docker:index:RemoteImage alpineImage create Outputs: @@ -180,9 +180,9 @@ Resources: Do you want to perform this update? yes Updating (test1): - Type Name Status - + pulumi:pulumi:Stack alpine-pull-test1 created (0.07s) - + └─ docker:index:RemoteImage alpineImage created (0.03s) + Type Name Status + + pulumi:pulumi:Stack alpine-pull-test1 created (0.07s) + + └─ docker:index:RemoteImage alpineImage created (0.03s) Outputs: @@ -197,7 +197,7 @@ Duration: 1s After the Python script runs you have the container on your machine. Confirm this using the `docker images` command: -```bash +```console docker images ``` diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index 1bbbeef02c..58c184a262 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -45,11 +45,11 @@ aarch64 If you see a different result, you are not using an Arm computer running 64-bit Linux. -PyTorch requires Python 3 and can be installed with `pip`. +PyTorch requires Python 3 and can be installed with `pip`. For Ubuntu run: -```console +```bash sudo apt install python-is-python3 python3-pip -y ``` @@ -65,7 +65,7 @@ alias python=python3 To install PyTorch run: ```bash -sudo pip install torch torchvision torchaudio +sudo pip install torch torchvision torchaudio ``` ## Get started @@ -74,7 +74,7 @@ Test PyTorch: Use a text editor to copy and paste the code below into a text file named `pytorch.py` -```console +```python import torch print(torch.__version__) x = torch.rand(5,3) @@ -84,7 +84,7 @@ exit() Run the example code: -```console +```bash python ./pytorch.py ``` @@ -101,7 +101,7 @@ tensor([[0.7358, 0.4406, 0.3058], To get more details about the build options for PyTorch run: -```console +```python python -c "import torch; print(*torch.__config__.show().split(\"\n\"), sep=\"\n\")" ``` @@ -116,19 +116,19 @@ PyTorch built with: - LAPACK is enabled (usually provided by MKL) - NNPACK is enabled - CPU capability usage: NO AVX - - Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/opt/rh/devtoolset-10/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=open, TORCH_VERSION=2.2.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, + - Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/opt/rh/devtoolset-10/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=open, TORCH_VERSION=2.2.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, ``` -The configuration output is an advanced option to check the tools and structure used to build PyTorch. +The configuration output is an advanced option to check the tools and structure used to build PyTorch. ## BFloat16 floating-point number format -Recent Arm processors support the BFloat16 (BF16) number format in PyTorch. For example, AWS Graviton3 processors support BFloat16. +Recent Arm processors support the BFloat16 (BF16) number format in PyTorch. For example, AWS Graviton3 processors support BFloat16. To check if your system includes BFloat16, use the `lscpu` command: -```console +```bash lscpu | grep bf16 ``` @@ -140,7 +140,7 @@ Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asi If the result is blank, you do not have a processor with BFloat16. -BFloat16 provides improved performance and smaller memory footprint with the same dynamic range. You may see a slight drop in model inference accuracy with BFloat16, but the impact is acceptable for the majority of applications. +BFloat16 provides improved performance and smaller memory footprint with the same dynamic range. You may see a slight drop in model inference accuracy with BFloat16, but the impact is acceptable for the majority of applications. You can use an environment variable to enable BFloat16: @@ -152,11 +152,11 @@ export DNNL_DEFAULT_FPMATH_MODE=BF16 LRU cache capacity is used to avoid redundant primitive creation latency overhead. -This caching feature increases memory usage. If needed, you can lower the value to reduce memory usage. +This caching feature increases memory usage. If needed, you can lower the value to reduce memory usage. You should tune the capacity to an optimal value for your use case. -Use an environment variable to set the value. The recommended starting value is: +Use an environment variable to set the value. The recommended starting value is: ```console export LRU_CACHE_CAPACITY=1024 @@ -164,15 +164,15 @@ export LRU_CACHE_CAPACITY=1024 ## Transparent huge pages -Transparent huge pages (THP) provide an alternative method of utilizing huge pages for virtual memory. Enabling THP may result in improved performance because it reduces the overhead of Translation Lookaside Buffer (TLB) lookups by using a larger virtual memory page size. +Transparent huge pages (THP) provide an alternative method of utilizing huge pages for virtual memory. Enabling THP may result in improved performance because it reduces the overhead of Translation Lookaside Buffer (TLB) lookups by using a larger virtual memory page size. To check if THP is available on your system, run: -```console +```bash cat /sys/kernel/mm/transparent_hugepage/enabled ``` -The setting in brackets is your current setting. +The setting in brackets is your current setting. The most common output, `madvise`, is shown below: @@ -182,7 +182,7 @@ always [madvise] never If the setting is `never`, you can change to `madvise` by running: -```console +```bash echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled ``` @@ -218,7 +218,7 @@ print(prof.key_averages().table(sort_by="self_cpu_time_total")) Run the example and check the performance information printed: -```console +```bash python ./profile.py ``` @@ -259,9 +259,9 @@ STAGE:2024-02-13 18:20:16 1981:1981 ActivityProfilerController.cpp:324] Complete Self CPU time total: 14.352s ``` -Experiment with the 2 environment variables for BFloat16 and THP and observe the performance differences. +Experiment with the 2 environment variables for BFloat16 and THP and observe the performance differences. -You can set each variable and run the test again and observe the new profile data and run time. +You can set each variable and run the test again and observe the new profile data and run time. You are ready to use PyTorch on Arm Linux. diff --git a/tools/check.py b/tools/check.py index 4e4a63e77c..ec6592e57f 100644 --- a/tools/check.py +++ b/tools/check.py @@ -271,6 +271,16 @@ def check(json_file, start, stop, md_article): if os.path.exists(test_cmd_filename): os.remove(test_cmd_filename) + # Remove files that were generated from the tests, if any + untracked_files_process = subprocess.run("git ls-files --others --exclude-standard", shell=True, capture_output=True) + generated_files = untracked_files_process.stdout.splitlines() + if generated_files: + logging.info(f"Removing files that was created during testing from repository") + logging.info(generated_files) + for file in generated_files: + os.remove(file) + logging.debug(f"Removed {file}") + # Stop instance if stop: logging.debug("Terminating container(s)") From e3cb9d1945f8bceb4fcf5cc0dfae3f40e7ae308f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 13:46:59 +0100 Subject: [PATCH 026/185] Address test failures in PR --- content/install-guides/multipass.md | 8 ++++---- content/install-guides/papi.md | 1 + content/install-guides/perf.md | 2 +- content/install-guides/pytorch.md | 4 ++-- tools/check.py | 10 ++++++---- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index a41f7af9a8..a00cc6f146 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -52,7 +52,7 @@ Multipass uses the terms virtual machine and instance synonymously. Download Multipass for macOS. -```bash +```console wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg ``` @@ -60,7 +60,7 @@ wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multip Install the download using the package command. -```bash +```console sudo installer -pkg multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg -target / ``` @@ -91,7 +91,7 @@ sudo apt install cpu-checker -y To check if KVM is available run: ```bash -kvm-ok +sudo kvm-ok ``` If KVM is available the output will be similar to: @@ -166,7 +166,7 @@ Multipass runs Ubuntu images. The last three LTS (long-term support) versions ar To see the available images run the `find` command. Any of the listed images can be used to create a new instance. ```bash -multipass find +sudo multipass find ``` The output from `find` will be similar to the below. diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index b9ea8d6c2e..d309ed105a 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -65,6 +65,7 @@ cd papi/src 2. Configure and compile the source code: ```bash { target="ubuntu:latest" } +chmod +x configure ./configure && make ``` diff --git a/content/install-guides/perf.md b/content/install-guides/perf.md index 30cf789216..e2abeb0212 100644 --- a/content/install-guides/perf.md +++ b/content/install-guides/perf.md @@ -140,7 +140,7 @@ You can copy it to a location in your search path or run it from the current loc To copy it use: -```bash +```console sudo cp tools/perf/perf /usr/local/bin ``` diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index 58c184a262..52d1001c7f 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -85,7 +85,7 @@ exit() Run the example code: ```bash -python ./pytorch.py +python pytorch.py ``` The expected output is similar to: @@ -219,7 +219,7 @@ print(prof.key_averages().table(sort_by="self_cpu_time_total")) Run the example and check the performance information printed: ```bash -python ./profile.py +python profile.py ``` The output will be similar to: diff --git a/tools/check.py b/tools/check.py index ec6592e57f..b2be7be8d2 100644 --- a/tools/check.py +++ b/tools/check.py @@ -273,11 +273,13 @@ def check(json_file, start, stop, md_article): # Remove files that were generated from the tests, if any untracked_files_process = subprocess.run("git ls-files --others --exclude-standard", shell=True, capture_output=True) - generated_files = untracked_files_process.stdout.splitlines() - if generated_files: + untracked_files = untracked_files_process.stdout.decode("utf-8").splitlines() + files_to_remove = [ file for file in untracked_files if "_cmd.json" not in file ] + + if files_to_remove: logging.info(f"Removing files that was created during testing from repository") - logging.info(generated_files) - for file in generated_files: + logging.info(files_to_remove) + for file in files_to_remove: os.remove(file) logging.debug(f"Removed {file}") From e7f3465f7ebe95cb7f8e250c82d1d4259579055f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 15:29:58 +0100 Subject: [PATCH 027/185] Address test failures in PR --- content/install-guides/multipass.md | 4 ++-- content/install-guides/papi.md | 4 ++-- content/install-guides/perf.md | 5 ++--- content/install-guides/pytorch.md | 2 +- tools/check.py | 15 +++++++++------ 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index a00cc6f146..abdcfbc29b 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -90,8 +90,8 @@ sudo apt install cpu-checker -y To check if KVM is available run: -```bash -sudo kvm-ok +```console +kvm-ok ``` If KVM is available the output will be similar to: diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index d309ed105a..4b6e34a59a 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -59,14 +59,14 @@ sudo apt install -y make gcc ```bash { target="ubuntu:latest" } git clone https://github.com/icl-utk-edu/papi/ -cd papi/src ``` 2. Configure and compile the source code: ```bash { target="ubuntu:latest" } +cd papi/src chmod +x configure -./configure && make +configure && make ``` 3. Configure and compile the source code: diff --git a/content/install-guides/perf.md b/content/install-guides/perf.md index e2abeb0212..d69ab029cd 100644 --- a/content/install-guides/perf.md +++ b/content/install-guides/perf.md @@ -194,7 +194,6 @@ branch: [Mispredicted or not predicted branch speculatively executed] br_pred [Predictable branch speculatively executed] - ``` Perf is not working correctly if you see output similar to the messages below. To fix the errors you need to [build Perf from source](#source). @@ -223,7 +222,7 @@ E: linux-perf-5.15 is not installed. ### Generate a test Perf report Generate a simple Perf report. For example: -```bash +```console perf stat -a pwd ``` The `pwd` command output will be shown as well as the report: @@ -295,7 +294,7 @@ Arm systems use a kernel driver to expose PMU hardware counters. The driver need To check if the driver is running use the `dmesg` command: ```bash -dmesg | grep "PMU driver" +sudo dmesg | grep "PMU driver" ``` {{% notice Note%}} diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index 52d1001c7f..1aff5358ff 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -128,7 +128,7 @@ Recent Arm processors support the BFloat16 (BF16) number format in PyTorch. For To check if your system includes BFloat16, use the `lscpu` command: -```bash +```console lscpu | grep bf16 ``` diff --git a/tools/check.py b/tools/check.py index b2be7be8d2..d8b48b40a6 100644 --- a/tools/check.py +++ b/tools/check.py @@ -274,14 +274,17 @@ def check(json_file, start, stop, md_article): # Remove files that were generated from the tests, if any untracked_files_process = subprocess.run("git ls-files --others --exclude-standard", shell=True, capture_output=True) untracked_files = untracked_files_process.stdout.decode("utf-8").splitlines() - files_to_remove = [ file for file in untracked_files if "_cmd.json" not in file ] + paths_to_remove = [ file for file in untracked_files if "_cmd.json" not in file ] - if files_to_remove: + if paths_to_remove: logging.info(f"Removing files that was created during testing from repository") - logging.info(files_to_remove) - for file in files_to_remove: - os.remove(file) - logging.debug(f"Removed {file}") + logging.info(paths_to_remove) + for path in paths_to_remove: + if os.path.isfile(path): + os.remove(path) + elif os.path.isdir(path): + os.removedirs(path) + logging.debug(f"Removed {path}") # Stop instance if stop: From 27dad7db72ff2d2c565ae0ee3640b8a1b2f2f765 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 15:44:34 +0100 Subject: [PATCH 028/185] Address test failures in PR --- content/install-guides/pytorch.md | 4 ++-- tools/check.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index 1aff5358ff..30e68340a1 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -74,7 +74,7 @@ Test PyTorch: Use a text editor to copy and paste the code below into a text file named `pytorch.py` -```python +```python { file_name="pytorch.py" } import torch print(torch.__version__) x = torch.rand(5,3) @@ -198,7 +198,7 @@ export THP_MEM_ALLOC_ENABLE=1 Use a text editor to save the code below as `profile.py`: -```python +```python { file_name="profile.py" } import torch from torch.profiler import profile, record_function, ProfilerActivity diff --git a/tools/check.py b/tools/check.py index d8b48b40a6..0b66b86b7c 100644 --- a/tools/check.py +++ b/tools/check.py @@ -2,6 +2,7 @@ import logging import os +import shutil import subprocess import json from junit_xml import TestCase @@ -283,7 +284,7 @@ def check(json_file, start, stop, md_article): if os.path.isfile(path): os.remove(path) elif os.path.isdir(path): - os.removedirs(path) + shutil.rmtree(path) logging.debug(f"Removed {path}") # Stop instance From 81263b91b39ca3d59beedd89956f3f0aba508ad4 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 15:57:02 +0100 Subject: [PATCH 029/185] Fix papi.md test failures in PR --- content/install-guides/papi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 4b6e34a59a..95f9974765 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -66,7 +66,7 @@ git clone https://github.com/icl-utk-edu/papi/ ```bash { target="ubuntu:latest" } cd papi/src chmod +x configure -configure && make +./configure && make ``` 3. Configure and compile the source code: From 54e8d158ca77142aba6a813d11a20a95171f40d6 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 08:47:42 +0100 Subject: [PATCH 030/185] Update papi.md and debug results dict --- content/install-guides/papi.md | 2 +- tools/maintenance.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 95f9974765..60dbb4e5e8 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -72,7 +72,7 @@ chmod +x configure 3. Configure and compile the source code: ```bash { target="ubuntu:latest" } -sudo make install +make install ``` 4. Copy the test program below and paste it into a text file named `papi-test.c``: diff --git a/tools/maintenance.py b/tools/maintenance.py index 666a3e847a..513498512a 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -158,6 +158,8 @@ def main(): if all(results_dict.get(k) for k in results_dict): # Errors exist sys.exit(1) + else: + logging.info(results_dict) elif args.spelling: logging.info(f"Checking spelling of {args.spelling}") output = parse.spelling(args.spelling) From e2a1e9d665a99deac16ed7bcc9049762aa1d2d35 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 09:06:13 +0100 Subject: [PATCH 031/185] Debug results dict --- tools/check.py | 2 -- tools/maintenance.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/check.py b/tools/check.py index 0b66b86b7c..c49af23285 100644 --- a/tools/check.py +++ b/tools/check.py @@ -279,7 +279,6 @@ def check(json_file, start, stop, md_article): if paths_to_remove: logging.info(f"Removing files that was created during testing from repository") - logging.info(paths_to_remove) for path in paths_to_remove: if os.path.isfile(path): os.remove(path) @@ -301,5 +300,4 @@ def check(json_file, start, stop, md_article): subprocess.run(cleanup_cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT) else: logging.debug("Parameter stop is false, skipping container(s) termination") - return results \ No newline at end of file diff --git a/tools/maintenance.py b/tools/maintenance.py index 513498512a..5054247004 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -155,11 +155,11 @@ def main(): if args.stats_report: # If all test results are zero, all tests have passed patch.patch(args.instructions, results_dict, args.link) + logging.info(results_dict) if all(results_dict.get(k) for k in results_dict): # Errors exist + logging.info("Tests failed in test suite") sys.exit(1) - else: - logging.info(results_dict) elif args.spelling: logging.info(f"Checking spelling of {args.spelling}") output = parse.spelling(args.spelling) From 00accaa2e4e580c532e2903604aa12bd0ddca336 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 10:18:09 +0100 Subject: [PATCH 032/185] Debug pipefail in test-lp.yml --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index f2355f7dfd..00cd6ed436 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -22,7 +22,7 @@ jobs: if: steps.changed-markdown-files.outputs.any_changed == 'true' # Run the test suite, and then determine if maintenance is turned off run: | - set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt + ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt - name: Parse maintenance state id: maintenance-state if: success() From 30127613a84ed0df240cf7717082fb610407ff15 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 12:33:41 +0100 Subject: [PATCH 033/185] Additional failure check in test-lp.yml --- .github/workflows/test-lp.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 00cd6ed436..c7e93d6ebc 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -22,7 +22,18 @@ jobs: if: steps.changed-markdown-files.outputs.any_changed == 'true' # Run the test suite, and then determine if maintenance is turned off run: | - ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt + set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt + - name: Check test suite for uncaught errors + id: test-suite-state + if: success() + # Catch any missed errors if running multiple tests + run: | + cat output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ + || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" + - name: Test condition + if: success() && steps.test-suite-state.outputs.TEST_SUITE_ERRORS == 'true' + # 'echo $?' returns with exit code 1 + run: echo $? - name: Parse maintenance state id: maintenance-state if: success() From 4c4c9b248d339366bb70fae399a81816d59fa119 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 12:55:06 +0100 Subject: [PATCH 034/185] Additional failure check in test-lp.yml --- .github/workflows/test-lp.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index c7e93d6ebc..6b49833c89 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -20,14 +20,10 @@ jobs: - name: Run test suite for all changed files id: run-suite if: steps.changed-markdown-files.outputs.any_changed == 'true' - # Run the test suite, and then determine if maintenance is turned off - run: | - set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt - - name: Check test suite for uncaught errors - id: test-suite-state - if: success() + # Run the test suite # Catch any missed errors if running multiple tests run: | + set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt cat output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" - name: Test condition From 3899afecbd58a6550ab7731dab178a0377f50934 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 15:51:40 +0100 Subject: [PATCH 035/185] Keep logs from being deleted --- .github/workflows/test-lp.yml | 8 ++++---- tools/check.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 6b49833c89..ca70b99bbc 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -23,11 +23,11 @@ jobs: # Run the test suite # Catch any missed errors if running multiple tests run: | - set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee output.txt - cat output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ + set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt + cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" - name: Test condition - if: success() && steps.test-suite-state.outputs.TEST_SUITE_ERRORS == 'true' + if: success() && steps.run-suite.outputs.TEST_SUITE_ERRORS == 'true' # 'echo $?' returns with exit code 1 run: echo $? - name: Parse maintenance state @@ -35,7 +35,7 @@ jobs: if: success() # Check if maintenance is turned off run: | - cat output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ + cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ || echo "{MAINTENANCE}=on" >> "$GITHUB_ENV" - name: Test condition if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'off' diff --git a/tools/check.py b/tools/check.py index c49af23285..02db2e5d61 100644 --- a/tools/check.py +++ b/tools/check.py @@ -275,7 +275,7 @@ def check(json_file, start, stop, md_article): # Remove files that were generated from the tests, if any untracked_files_process = subprocess.run("git ls-files --others --exclude-standard", shell=True, capture_output=True) untracked_files = untracked_files_process.stdout.decode("utf-8").splitlines() - paths_to_remove = [ file for file in untracked_files if "_cmd.json" not in file ] + paths_to_remove = [ file for file in untracked_files if "_cmd.json" or "test-lp-output.txt" not in file ] if paths_to_remove: logging.info(f"Removing files that was created during testing from repository") From f79a00aa0e0b92de4524c9990781ae4904e280f1 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 29 Oct 2024 16:12:56 +0100 Subject: [PATCH 036/185] Update conditions for file removal --- tools/check.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/check.py b/tools/check.py index 02db2e5d61..a596ed7379 100644 --- a/tools/check.py +++ b/tools/check.py @@ -275,7 +275,9 @@ def check(json_file, start, stop, md_article): # Remove files that were generated from the tests, if any untracked_files_process = subprocess.run("git ls-files --others --exclude-standard", shell=True, capture_output=True) untracked_files = untracked_files_process.stdout.decode("utf-8").splitlines() - paths_to_remove = [ file for file in untracked_files if "_cmd.json" or "test-lp-output.txt" not in file ] + paths_to_remove = [ file for file in untracked_files \ + if "_cmd.json" not in file \ + or "test-lp-output.txt" not in file ] if paths_to_remove: logging.info(f"Removing files that was created during testing from repository") From c9e6a3c9a65bca4069eb0d3ea9d429befa4f852b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 09:10:51 +0100 Subject: [PATCH 037/185] Update file removal condition --- tools/check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/check.py b/tools/check.py index a596ed7379..99e4be6669 100644 --- a/tools/check.py +++ b/tools/check.py @@ -275,9 +275,9 @@ def check(json_file, start, stop, md_article): # Remove files that were generated from the tests, if any untracked_files_process = subprocess.run("git ls-files --others --exclude-standard", shell=True, capture_output=True) untracked_files = untracked_files_process.stdout.decode("utf-8").splitlines() - paths_to_remove = [ file for file in untracked_files \ - if "_cmd.json" not in file \ - or "test-lp-output.txt" not in file ] + paths_to_remove = [ file_name for file_name in untracked_files \ + if "_cmd.json" not in file_name \ + and "test-lp-output.txt" not in file_name ] if paths_to_remove: logging.info(f"Removing files that was created during testing from repository") From 207f9693be4aae8c4d75991e337cc308e4fa1d4e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 09:35:40 +0100 Subject: [PATCH 038/185] Debug papi.md --- content/install-guides/papi.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 60dbb4e5e8..ee4ad9b238 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -66,7 +66,9 @@ git clone https://github.com/icl-utk-edu/papi/ ```bash { target="ubuntu:latest" } cd papi/src chmod +x configure -./configure && make +./configure +ls +make ``` 3. Configure and compile the source code: From ad6476491d00f95336131a9d80ac3cfd28289d12 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 10:14:42 +0100 Subject: [PATCH 039/185] Separate steps in test-lp.yml --- .github/workflows/test-lp.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index ca70b99bbc..beeae64f9c 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -24,13 +24,18 @@ jobs: # Catch any missed errors if running multiple tests run: | set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt + - name: Parse test suite errors + id: test-suite-state + if: success() + # Check if maintenance is turned off + run: | cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" - name: Test condition - if: success() && steps.run-suite.outputs.TEST_SUITE_ERRORS == 'true' + if: success() && steps.test-suite-state.outputs.TEST_SUITE_ERRORS == 'true' # 'echo $?' returns with exit code 1 run: echo $? - - name: Parse maintenance state + - name: Parse test maintenance off id: maintenance-state if: success() # Check if maintenance is turned off From 99336dd0a17fc8b8604832bbbecd0606845ce802 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 10:25:54 +0100 Subject: [PATCH 040/185] Remove success condition in test-lp.yml --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index beeae64f9c..ff126ca524 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -32,7 +32,7 @@ jobs: cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" - name: Test condition - if: success() && steps.test-suite-state.outputs.TEST_SUITE_ERRORS == 'true' + if: steps.test-suite-state.outputs.TEST_SUITE_ERRORS == 'true' # 'echo $?' returns with exit code 1 run: echo $? - name: Parse test maintenance off @@ -43,7 +43,7 @@ jobs: cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ || echo "{MAINTENANCE}=on" >> "$GITHUB_ENV" - name: Test condition - if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'off' + if: steps.maintenance-state.outputs.MAINTENANCE == 'off' # Skip opening a PR if tests have not been run run: echo "Maintenance is turned off for one or more files, skipping tests" - name: Create Pull Request From c0fad7add6a345c65179d831a4badb0ea9f8f328 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 10:44:18 +0100 Subject: [PATCH 041/185] Change conditions in test-lp.yml --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index ff126ca524..3e24b43729 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -32,7 +32,7 @@ jobs: cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" - name: Test condition - if: steps.test-suite-state.outputs.TEST_SUITE_ERRORS == 'true' + if: success() && ${{ env.TEST_SUITE_ERRORS == 'true' }} # 'echo $?' returns with exit code 1 run: echo $? - name: Parse test maintenance off @@ -43,7 +43,7 @@ jobs: cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ || echo "{MAINTENANCE}=on" >> "$GITHUB_ENV" - name: Test condition - if: steps.maintenance-state.outputs.MAINTENANCE == 'off' + if: success() && ${{ env.MAINTENANCE == 'off' }} # Skip opening a PR if tests have not been run run: echo "Maintenance is turned off for one or more files, skipping tests" - name: Create Pull Request From 0e127af6a1692aa60e5aa1b4da577bd396b6e8a5 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 10:57:03 +0100 Subject: [PATCH 042/185] Change exit step in test-lp.yml --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 3e24b43729..f6506ab25d 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -34,7 +34,7 @@ jobs: - name: Test condition if: success() && ${{ env.TEST_SUITE_ERRORS == 'true' }} # 'echo $?' returns with exit code 1 - run: echo $? + run: exit 1 - name: Parse test maintenance off id: maintenance-state if: success() @@ -45,7 +45,7 @@ jobs: - name: Test condition if: success() && ${{ env.MAINTENANCE == 'off' }} # Skip opening a PR if tests have not been run - run: echo "Maintenance is turned off for one or more files, skipping tests" + run: echo "Maintenance is turned off for one or more files" - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'on' From cac0171def2481fa09eb0b94b02b5d5c1bf66326 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 11:17:38 +0100 Subject: [PATCH 043/185] Debug papi.md and clean up workflow files --- .github/workflows/test-lp.yml | 4 +++- .github/workflows/test_lp.sh | 2 +- content/install-guides/papi.md | 2 +- tools/maintenance.py | 1 - 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index f6506ab25d..c7d4452d2e 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -34,7 +34,9 @@ jobs: - name: Test condition if: success() && ${{ env.TEST_SUITE_ERRORS == 'true' }} # 'echo $?' returns with exit code 1 - run: exit 1 + run: | + echo "Test failures detected in test suite, check the output in earlier steps" + exit 1 - name: Parse test maintenance off id: maintenance-state if: success() diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index e7cac12f88..326c04d258 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -19,5 +19,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} + tools/maintenance.py -i ${file} --debug done diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index ee4ad9b238..5339af947b 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -67,13 +67,13 @@ git clone https://github.com/icl-utk-edu/papi/ cd papi/src chmod +x configure ./configure -ls make ``` 3. Configure and compile the source code: ```bash { target="ubuntu:latest" } +ls make install ``` diff --git a/tools/maintenance.py b/tools/maintenance.py index 5054247004..7ce713eb4b 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -155,7 +155,6 @@ def main(): if args.stats_report: # If all test results are zero, all tests have passed patch.patch(args.instructions, results_dict, args.link) - logging.info(results_dict) if all(results_dict.get(k) for k in results_dict): # Errors exist logging.info("Tests failed in test suite") From 60257c82a6dfe8abf0034879be0357312ed86643 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 11:33:28 +0100 Subject: [PATCH 044/185] Debug papi.md --- content/install-guides/papi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 5339af947b..dfa8a26aaa 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -73,7 +73,7 @@ make 3. Configure and compile the source code: ```bash { target="ubuntu:latest" } -ls +cd src make install ``` From 241087676259ed751df73d20ba38f7102206624c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 11:38:59 +0100 Subject: [PATCH 045/185] Debug papi.md --- content/install-guides/papi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index dfa8a26aaa..48aede1339 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -73,7 +73,7 @@ make 3. Configure and compile the source code: ```bash { target="ubuntu:latest" } -cd src +pwd make install ``` From 4467a2fd2c1b8665be8adacafd86a995444af453 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 11:50:15 +0100 Subject: [PATCH 046/185] Debug papi.md --- content/install-guides/papi.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 48aede1339..1f2286eb15 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -70,10 +70,13 @@ chmod +x configure make ``` +```bash +pwd +``` + 3. Configure and compile the source code: ```bash { target="ubuntu:latest" } -pwd make install ``` From bc2125958358e7e6b7a3fbcf6315be1fc18fa5c7 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 13:06:35 +0100 Subject: [PATCH 047/185] Update papi.md --- content/install-guides/papi.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 1f2286eb15..97eb41c6c3 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -70,13 +70,10 @@ chmod +x configure make ``` -```bash -pwd -``` - 3. Configure and compile the source code: ```bash { target="ubuntu:latest" } +cd papi/src make install ``` From b5ca3044f3c6b1273e6e4a4a0b4fe97fc773a814 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 13:11:55 +0100 Subject: [PATCH 048/185] Update papi.md --- content/install-guides/papi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/papi.md b/content/install-guides/papi.md index 97eb41c6c3..b6b84385ed 100644 --- a/content/install-guides/papi.md +++ b/content/install-guides/papi.md @@ -74,7 +74,7 @@ make ```bash { target="ubuntu:latest" } cd papi/src -make install +sudo make install ``` 4. Copy the test program below and paste it into a text file named `papi-test.c``: From 0aebaf2ae5d86a0e94327ec88f74cef7ee9ed0d9 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 13:30:33 +0100 Subject: [PATCH 049/185] Disable debugging, update conditions in test-lp.yml --- .github/workflows/test-lp.yml | 13 ++++++------- .github/workflows/test_lp.sh | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index c7d4452d2e..704ef06494 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -29,11 +29,10 @@ jobs: if: success() # Check if maintenance is turned off run: | - cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "{TEST_SUITE_ERRORS}=true" >> "$GITHUB_ENV" \ - || echo "{TEST_SUITE_ERRORS}=false" >> "$GITHUB_ENV" + cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "TEST_SUITE_ERRORS=true" >> "$GITHUB_ENV" \ + || echo "TEST_SUITE_ERRORS=false" >> "$GITHUB_ENV" - name: Test condition - if: success() && ${{ env.TEST_SUITE_ERRORS == 'true' }} - # 'echo $?' returns with exit code 1 + if: env.TEST_SUITE_ERRORS == 'true' && success() run: | echo "Test failures detected in test suite, check the output in earlier steps" exit 1 @@ -42,10 +41,10 @@ jobs: if: success() # Check if maintenance is turned off run: | - cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "{MAINTENANCE}=off" >> "$GITHUB_ENV" \ - || echo "{MAINTENANCE}=on" >> "$GITHUB_ENV" + cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "MAINTENANCE=off" >> "$GITHUB_ENV" \ + || echo "MAINTENANCE=on" >> "$GITHUB_ENV" - name: Test condition - if: success() && ${{ env.MAINTENANCE == 'off' }} + if: env.MAINTENANCE == 'off' && success() # Skip opening a PR if tests have not been run run: echo "Maintenance is turned off for one or more files" - name: Create Pull Request diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index 326c04d258..e7cac12f88 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -19,5 +19,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} --debug + tools/maintenance.py -i ${file} done From ed7f5e0dad47d2e8f2527ab098b924e16a839258 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 13:51:45 +0100 Subject: [PATCH 050/185] Enable pulumi.md --- .github/workflows/test-lp.yml | 3 +-- content/install-guides/pulumi.md | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 704ef06494..e75bca257a 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -21,13 +21,12 @@ jobs: id: run-suite if: steps.changed-markdown-files.outputs.any_changed == 'true' # Run the test suite - # Catch any missed errors if running multiple tests run: | set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt - name: Parse test suite errors id: test-suite-state if: success() - # Check if maintenance is turned off + # Catch any missed errors if running multiple tests run: | cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "TEST_SUITE_ERRORS=true" >> "$GITHUB_ENV" \ || echo "TEST_SUITE_ERRORS=false" >> "$GITHUB_ENV" diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index 61f58389ef..84c942de73 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -4,6 +4,7 @@ minutes_to_complete: 5 official_docs: https://www.pulumi.com/docs/ author_primary: Jason Andrews +test_maintenance: true test_images: - ubuntu:latest From fe864d5e28126fd8fe8b38e8f973ee44ca3ef512 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 14:06:21 +0100 Subject: [PATCH 051/185] Update pulumi.md and raise errors as SystemExit --- content/install-guides/pulumi.md | 5 +++-- tools/check.py | 2 +- tools/maintenance.py | 2 +- tools/parse.py | 2 +- tools/patch.py | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index 84c942de73..f08e6438fe 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -57,14 +57,14 @@ source $HOME/.bashrc Confirm `pulumi` is now in the search path: -```bash { env_source="~/.bashrc" | "2"} +```bash { env_source="~/.bashrc" | 2 } which pulumi /home/ubuntu/.pulumi/bin/pulumi ``` Print the version: -```bash { env_source="~/.bashrc" | "2"} +```bash { env_source="~/.bashrc" | 2 } pulumi version v3.78.0 ``` @@ -209,3 +209,4 @@ REPOSITORY TAG IMAGE ID CREATED SIZE alpine latest f6648c04cd6c 2 days ago 7.66MB ``` + diff --git a/tools/check.py b/tools/check.py index 99e4be6669..8d4f20fc17 100644 --- a/tools/check.py +++ b/tools/check.py @@ -49,7 +49,7 @@ def init_container(i_img, img): package_manager = "yum" user = "wheel" else: - raise IOError(f"Image {img} not supported") + raise SystemExit(f"Image {img} not supported") docker_cmd = [f"docker exec test_{i_img} {package_manager} update"] logging.debug(docker_cmd) diff --git a/tools/maintenance.py b/tools/maintenance.py index 7ce713eb4b..c625d18163 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -105,7 +105,7 @@ def main(): if args.instructions: if not os.path.exists(args.instructions): - raise FileNotFoundError(f"No such file or directory: {args.instructions}") + raise SystemExit(f"No such file or directory: {args.instructions}") results_dict = {} # check if article is a csv file corresponding to a file list if args.instructions.endswith(".csv"): diff --git a/tools/parse.py b/tools/parse.py index b6db15d21c..d56bbb6206 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -197,7 +197,7 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): elif len(expected_result) == 1 and expected_result[0]: expected_lines = [int(expected_result[0])-1] else: - raise IOError( + raise SystemExit( """The expected output line(s) should be specified as one of two options: A single number: | 2 A range: | 2-10 diff --git a/tools/patch.py b/tools/patch.py index 5570a7cbf3..95463c18fe 100644 --- a/tools/patch.py +++ b/tools/patch.py @@ -24,7 +24,7 @@ def patch(article_path: str, results: dict, link: str): content_title = content_title.strip(".md") sw_category = content_type else: - raise IOError("Unknown content path, pass learning paths or install guides only") + raise SystemExit("Unknown content path, pass learning paths or install guides only") test_images = results.keys() results_values = defaultdict(lambda: "failed") @@ -32,7 +32,7 @@ def patch(article_path: str, results: dict, link: str): for image, i in zip(test_images, range(len(test_images))): if content_title not in data["sw_categories"][sw_category]: - raise KeyError(f"{content_title} does not exist in {stats_file}. Add it to update the stats report.") + raise SystemExit(f"{content_title} does not exist in {stats_file}. Add it to update the stats report.") data["sw_categories"][sw_category][content_title]["tests_and_status"][i][image] = results_values[results[image]] From d6ee5fac22b5fe709e6d01949c0ba277a0d9d6b9 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 14:15:51 +0100 Subject: [PATCH 052/185] Update regex parsing of expected lines --- tools/parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/parse.py b/tools/parse.py index d56bbb6206..edfcd65204 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -191,7 +191,7 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): arg_str = cmd_str.split(arg)[1].split("\"")[0] content[cmd_idx].update({arg:arg_str}) if "|" in cmd_lines_header: - expected_result = cmd_str.split("| ")[1].split("\"")[0].split("-") + expected_result = cmd_str.split("| ")[1].split("}")[0].split("-") if len(expected_result) > 1: expected_lines = list(range(*[int(x)-1 for x in expected_result])) elif len(expected_result) == 1 and expected_result[0]: From 3faf58574ecebd4be456e81e1b0ac7bc8e372b10 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 14:28:08 +0100 Subject: [PATCH 053/185] Update pulumi.md --- content/install-guides/pulumi.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index f08e6438fe..cf63cb5fba 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -57,16 +57,16 @@ source $HOME/.bashrc Confirm `pulumi` is now in the search path: -```bash { env_source="~/.bashrc" | 2 } +```bash which pulumi -/home/ubuntu/.pulumi/bin/pulumi +/usr/local/bin/pulumi ``` Print the version: -```bash { env_source="~/.bashrc" | 2 } +```bash pulumi version -v3.78.0 +v3.135.1 ``` You are ready to use Pulumi on your Linux machine. @@ -87,21 +87,21 @@ You also need Python. Make sure you have `python` and `pip` installed. For `Ubuntu 22.04` on Arm you can run the commands below to install: -```bash { env_source="~/.bashrc" } +```bash sudo apt install python-is-python3 -y sudo apt install python3-pip -y ``` Create a new directory for the example: -```bash { env_source="~/.bashrc" } +```bash mkdir pulumi-test ; cd pulumi-test ``` Log in to your local machine, a shortcut to use `~/.pulumi` to store project data. -```bash { env_source="~/.bashrc" } -pulumi login --local +```bash +pulumi login --local --yes ``` For the example you need to create 3 files: @@ -111,14 +111,14 @@ For the example you need to create 3 files: Use a text editor to copy the code below to a file named `requirements.txt`. -```python +```output { file_name="requirements.txt" } pulumi>=3.0.0 pulumi-docker>=4.0.0 ``` Use a text editor to copy the lines below to a file named `Pulumi.yaml` -```yaml +```yaml { file_name="Pulimi.yaml" } name: alpine-pull runtime: python description: A pulumi application pull the alpine image @@ -126,7 +126,7 @@ description: A pulumi application pull the alpine image Use a text editor to copy the lines below to a file named `__main__.py` -```python +```python { file_name="__main.py__" } import pulumi import pulumi_docker as docker @@ -139,13 +139,13 @@ pulumi.export('digest', image.repo_digest) With the three files created, install the required Python packages: -```bash { env_source="~/.bashrc" } +```bash pip install -r requirements.txt ``` Run the Python script to pull the container image: -```bash { env_source="~/.bashrc" } +```console pulumi up ``` From e6bf70faee780e6b5a23ff65fcd87688d9927b22 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 14:38:25 +0100 Subject: [PATCH 054/185] Update pulumi.md --- content/install-guides/pulumi.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index cf63cb5fba..4c6b4aafcd 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -59,6 +59,9 @@ Confirm `pulumi` is now in the search path: ```bash which pulumi +``` + +```output /usr/local/bin/pulumi ``` @@ -66,6 +69,9 @@ Print the version: ```bash pulumi version +``` + +```output v3.135.1 ``` @@ -101,7 +107,7 @@ mkdir pulumi-test ; cd pulumi-test Log in to your local machine, a shortcut to use `~/.pulumi` to store project data. ```bash -pulumi login --local --yes +pulumi login --local ``` For the example you need to create 3 files: @@ -145,8 +151,8 @@ pip install -r requirements.txt Run the Python script to pull the container image: -```console -pulumi up +```bash +pulumi up --yes ``` There are 4 prompts to respond to: From 6f9af56c724ff936e834d58c049a8bc399e9b141 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 14:45:36 +0100 Subject: [PATCH 055/185] Update pulumi.md --- content/install-guides/pulumi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index 4c6b4aafcd..764bc71c7d 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -124,7 +124,7 @@ pulumi-docker>=4.0.0 Use a text editor to copy the lines below to a file named `Pulumi.yaml` -```yaml { file_name="Pulimi.yaml" } +```yaml { file_name="Pulumi.yaml" } name: alpine-pull runtime: python description: A pulumi application pull the alpine image From c5a710430d76b11f9ed405688009bdfebb49bd88 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 14:56:27 +0100 Subject: [PATCH 056/185] Update pulumi.md --- content/install-guides/pulumi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index 764bc71c7d..6dfc0a038c 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -152,7 +152,7 @@ pip install -r requirements.txt Run the Python script to pull the container image: ```bash -pulumi up --yes +pulumi up --yes --stack ``` There are 4 prompts to respond to: From e78156b5118ec7c9419d93af6f86447b059dd26f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 15:14:33 +0100 Subject: [PATCH 057/185] Update pulumi.md --- content/install-guides/pulumi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/pulumi.md b/content/install-guides/pulumi.md index 6dfc0a038c..1f2130053f 100644 --- a/content/install-guides/pulumi.md +++ b/content/install-guides/pulumi.md @@ -151,8 +151,8 @@ pip install -r requirements.txt Run the Python script to pull the container image: -```bash -pulumi up --yes --stack +```console +pulumi up ``` There are 4 prompts to respond to: From f0bdedffbc72fa2c616b03f63ae2fd6cfa040d80 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 30 Oct 2024 15:30:00 +0100 Subject: [PATCH 058/185] Update stats file --- data/stats_current_test_info.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index c97a191f07..92314bfdab 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -98,6 +98,10 @@ sw_categories: readable_title: Linaro Forge tests_and_status: - ubuntu:latest: passed + gcloud: + readable_title: Google Cloud Platform (GCP) CLI + tests_and_status: + - ubuntu:latest: passed gfortran: readable_title: GFortran tests_and_status: @@ -109,6 +113,10 @@ sw_categories: readable_title: Kubectl tests_and_status: - ubuntu:latest: passed + multipass: + readable_title: Multipass + tests_and_status: + - ubuntu:latest: passed native: readable_title: Native compiler tests_and_status: @@ -118,6 +126,18 @@ sw_categories: readable_title: Oracle Cloud Infrastructure (OCI) CLI tests_and_status: - ubuntu:latest: passed + papi: + readable_title: Performance API (PAPI) + tests_and_status: + - ubuntu:latest: passed + perf: + readable_title: Perf for Linux on Arm (LinuxPerf) + tests_and_status: + - ubuntu:latest: passed + pulumi: + readable_title: Pulumi + tests_and_status: + - ubuntu:latest: passed pytorch: readable_title: PyTorch tests_and_status: From 54cfa0f1a60d60ce5698c56cf8b1d5073868fffb Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 13:13:21 +0100 Subject: [PATCH 059/185] Add Linux-based install guides --- content/install-guides/rust.md | 7 +-- content/install-guides/rust_embedded.md | 14 ++++-- content/install-guides/ssh.md | 64 +++++++++++++----------- content/install-guides/streamline-cli.md | 33 ++++++------ content/install-guides/sysbox.md | 36 +++++++------ content/install-guides/terraform.md | 10 ++-- content/install-guides/topdown-tool.md | 8 ++- content/install-guides/vnc.md | 23 +++++---- 8 files changed, 109 insertions(+), 86 deletions(-) diff --git a/content/install-guides/rust.md b/content/install-guides/rust.md index 9f1d846f40..029bb11df7 100644 --- a/content/install-guides/rust.md +++ b/content/install-guides/rust.md @@ -10,6 +10,7 @@ additional_search_terms: test_images: - ubuntu:latest +test_maintenance: true ### FIXED, DO NOT MODIFY weight: 1 # Defines page ordering. Must be 1 for first (or only) page. @@ -19,9 +20,9 @@ multitool_install_part: false # Set to true if a sub-page of a multi-page arti layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles --- -[Rust](https://www.rust-lang.org/) is an open source programming language. +[Rust](https://www.rust-lang.org/) is an open source programming language. -This install guide is for Linux application developers wishing to use Rust. +This install guide is for Linux application developers wishing to use Rust. If you wish to use Rust to build embedded applications for Arm, refer to [Rust for Embedded Applications](/install-guides/rust_embedded/) instead. @@ -113,7 +114,7 @@ To configure your current shell, run: source "$HOME/.cargo/env" ``` -The latest version of Rust is now installed. +The latest version of Rust is now installed. The installer updates `$HOME/.bashrc` and `SHOME/.profile` to set up the environment. Start a new shell or run the following command to continue: diff --git a/content/install-guides/rust_embedded.md b/content/install-guides/rust_embedded.md index b36c43bb91..95ec0547af 100644 --- a/content/install-guides/rust_embedded.md +++ b/content/install-guides/rust_embedded.md @@ -7,6 +7,10 @@ additional_search_terms: - compiler - rust +test_images: +- ubuntu:latest +test_maintenance: true + ### FIXED, DO NOT MODIFY weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -15,9 +19,9 @@ multitool_install_part: false # Set to true if a sub-page of a multi-page arti layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles --- -[Rust](https://www.rust-lang.org/) is an open source programming language. +[Rust](https://www.rust-lang.org/) is an open source programming language. -This install guide is for developers using Rust for their embedded applications. +This install guide is for developers using Rust for their embedded applications. If you are using Rust to build Linux applications on an Arm Linux platform, refer to [Rust for Linux Applications](/install-guides/rust/) instead. @@ -55,11 +59,11 @@ cargo 1.78.0 (54d8815d0 2024-03-26) ### Add Arm cross-compilation support Add cross compilation support for the required Arm Architectures. For example, to add support for Armv7-M architecture, you can use: -```command +```bash rustup target add thumbv7m-none-eabi ``` For a full list of supported architectures, use: -```command +```bash rustup target list ``` @@ -67,7 +71,7 @@ rustup target list To generate a project from a template, you need `cargo-generate`. To install and rebuild use: -```command +```bash sudo apt install -y libssl-dev pkg-config sudo apt install -y build-essential cargo install cargo-generate diff --git a/content/install-guides/ssh.md b/content/install-guides/ssh.md index 89830863f8..7f33ca74bc 100644 --- a/content/install-guides/ssh.md +++ b/content/install-guides/ssh.md @@ -17,6 +17,10 @@ author_primary: Jason Andrews ### Link to official documentation official_docs: https://www.openssh.com/manual.html +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -25,26 +29,26 @@ multitool_install_part: false # Set to true if a sub-page of a multi-page arti layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles --- -Secure Shell (SSH) is the primary tool used to connect to remote Linux servers. It provides a secure shell on a remote machine, and is used frequently in cloud and server development. +Secure Shell (SSH) is the primary tool used to connect to remote Linux servers. It provides a secure shell on a remote machine, and is used frequently in cloud and server development. This section provides answers to the most frequently asked SSH setup questions related to server and cloud development. -Feel free to seek out additional SSH tutorials or add more information to this page. +Feel free to seek out additional SSH tutorials or add more information to this page. -## SSH +## SSH SSH is a client server application. -An SSH server, also called the SSH daemon, runs on a remote machine. +An SSH server, also called the SSH daemon, runs on a remote machine. -An SSH client runs on the local machine (the one you are typing on) and connects to the remote daemon. +An SSH client runs on the local machine (the one you are typing on) and connects to the remote daemon. ### Decide if the SSH daemon is already running For SSH to work, the SSH daemon must be running on the remote machine. Many Linux distributions install and run the SSH daemon automatically. To find out if the SSH daemon is already running running use the `ps` command. -```console +```bash ps -ef | grep ssh ``` If the result includes a line with `sshd` the daemon is running. @@ -52,7 +56,7 @@ If the result includes a line with `sshd` the daemon is running. root 1113 1 0 18:48 ? 00:00:00 /usr/sbin/sshd -D ``` Another way to check if the SSH daemon is running is to query the SSH service. -```console +```bash sudo systemctl status sshd ``` If the output displays "running", then the SSH daemon is already running. @@ -65,34 +69,34 @@ If the SSH daemon is not running on the remote Linux machine, install it using t For Ubuntu/Debian distributions: ```bash -sudo apt-get install openssh-server +sudo apt-get install openssh-server ``` For Red Hat and Amazon Linux distributions. -```bash -sudo yum install openssh-server +```console +sudo yum install openssh-server ``` ### Start and stop the SSH daemon {#startstop} -The commands below are for any Linux distribution using `systemd`. This includes Debian, Ubuntu, and Amazon Linux. +The commands below are for any Linux distribution using `systemd`. This includes Debian, Ubuntu, and Amazon Linux. To start the SSH daemon: -```console -sudo systemctl start ssh +```bash +sudo systemctl start ssh ``` To stop the SSH daemon: -```console -sudo systemctl stop ssh +```bash +sudo systemctl stop ssh ``` To restart the SSH daemon: -```console -sudo systemctl restart ssh +```bash +sudo systemctl restart ssh ``` ### Use a password with SSH For security reasons, cloud instances don’t enable password logins and there is no password set for the user accounts (such as `ubuntu` or `ec2-user`). -Password access is useful to connect when the private key is not available. +Password access is useful to connect when the private key is not available. To enable passwords edit the file `/etc/sshd_config` and set `PasswordAuthentication` to `yes`. @@ -100,16 +104,16 @@ To enable it from the command line, run this command: ```console sudo sed -i '/PasswordAuthentication no/c\PasswordAuthentication yes' /etc/ssh/sshd_config ``` -Restart the SSH daemon using the commands [above](#startstop). +Restart the SSH daemon using the commands [above](#startstop). -To use a password for SSH a password must be created. +To use a password for SSH a password must be created. To create a password for the user ubuntu: ```console sudo passwd ubuntu ``` -For improved security, set the security group of the cloud instance to allow port 22 traffic (SSH) from a minimal set of IP addresses, not anywhere on the internet. Use password access with caution. +For improved security, set the security group of the cloud instance to allow port 22 traffic (SSH) from a minimal set of IP addresses, not anywhere on the internet. Use password access with caution. ### SSH keys @@ -119,7 +123,7 @@ If a new key pair is needed use the `ssh-keygen` command to generate a key pair: ```console ssh-keygen ``` -Answer the questions. Pressing enter to accept all defaults works fine. +Answer the questions. Pressing enter to accept all defaults works fine. By default, the keys are created in `~/.ssh/id_rsa.pub` (public key) and `~/.ssh/id_rsa` (private key) @@ -131,13 +135,13 @@ Accessing an AWS EC2 instance running Ubuntu using: ```console ssh -i ubuntu@ ``` -To use SSH without specifying `-i ` every time create an SSH configuration for the remote machine. +To use SSH without specifying `-i ` every time create an SSH configuration for the remote machine. -Edit the file `~/.ssh/config` on the local machine. +Edit the file `~/.ssh/config` on the local machine. Pick a name for the remote machine, such as `myserver`, add the public IP address or DNS name as the Hostname. -User is the username on the remote machine and IdentityFile is the path to the private key on the local machine. +User is the username on the remote machine and IdentityFile is the path to the private key on the local machine. ```output Host myserver @@ -154,13 +158,13 @@ ssh myserver ### Add a new key pair -If you want to give access to somebody else without enabling password access or sharing your private key, you can add another key pair to the remote machine. You may also want to change the key pair used when the remote machine was created. +If you want to give access to somebody else without enabling password access or sharing your private key, you can add another key pair to the remote machine. You may also want to change the key pair used when the remote machine was created. -To add or change the key pair edit the file `~/.ssh/authorized_keys` on the remote machine. +To add or change the key pair edit the file `~/.ssh/authorized_keys` on the remote machine. -Add a new public key to `authorized_keys`. You can also delete the current public key and just use the new one. +Add a new public key to `authorized_keys`. You can also delete the current public key and just use the new one. -If you ran `ssh-keygen` on your local machine, the public key is at `~/.ssh/id_rsa.pub` +If you ran `ssh-keygen` on your local machine, the public key is at `~/.ssh/id_rsa.pub` Use the new private key on the local machine to connect. If you have `~/.ssh/id_rsa` on your local machine it will be used automatically and you can SSH to the remote machine. @@ -169,7 +173,7 @@ Use the new private key on the local machine to connect. If you have `~/.ssh/id_ You can use port forwarding to access a port on a remote computer which is blocked by a firewall or security group. This is helpful when your application is running on a remote computer with SSH access, but no other ports are open. For example, if you are running a web application on a cloud instance and it uses port 3000 you can SSH to the cloud instance with port forwarding and access the application. ```console -ssh -i -L 3000:localhost:3000 ubuntu@ +ssh -i -L 3000:localhost:3000 ubuntu@ ``` Once you SSH, you can access `localhost:3000` and the traffic is forwarded to the remote computer. diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index b8ccdef52d..11ea2244be 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -19,6 +19,10 @@ author_primary: Julie Gaskin ### Link to official documentation official_docs: https://developer.arm.com/documentation/109847/latest/ +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -72,21 +76,18 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati 1. Download and extract the Streamline CLI tools on your Arm server: - ```sh - wget https://artifacts.tools.arm.com/arm-performance-studio/2024.3/Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  - tar -xzf Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  - ``` +```bash +wget https://artifacts.tools.arm.com/arm-performance-studio/2024.3/Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  +tar -xzf Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  +``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: - ```sh - # From Bash - python3 -m venv sl-venv - source ./sl-venv/bin/activate - - # From inside the virtual environment - python3 -m pip install -r ./streamline_cli_tools/bin/requirements.txt - ``` +```bash +python3 -m venv sl-venv +source ./sl-venv/bin/activate +python3 -m pip install -r ./streamline_cli_tools/bin/requirements.txt +``` {{% notice Note%}} The instructions in this guide assume you have added the `/bin/` directory to your `PATH` environment variable, and that you run all Python commands from inside the virtual environment. @@ -119,13 +120,13 @@ You might need to adapt them slightly to other Linux distributions. To apply the patch to the latest 6.7 kernel, you can use `git`: -```sh +```bash git apply v6.7-combined.patch ``` or `patch`: -```sh +```bash patch -p 1 -i v6.7-combined.patch ``` @@ -135,10 +136,10 @@ Follow these steps to integrate these patches into an RPM-based distribution's k 1. Install the RPM build tools: - ``` + ```sh sudo yum install rpm-build rpmdevtools ``` - + 1. Remove any existing `rpmbuild` directory, renaming as appropriate: ```sh diff --git a/content/install-guides/sysbox.md b/content/install-guides/sysbox.md index a135f2121b..33ad7876ec 100644 --- a/content/install-guides/sysbox.md +++ b/content/install-guides/sysbox.md @@ -21,6 +21,10 @@ author_primary: Jason Andrews ### Link to official documentation official_docs: https://github.com/nestybox/sysbox/blob/master/docs/user-guide/README.md +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -29,21 +33,21 @@ multitool_install_part: false # Set to true if a sub-page of a multi-page arti layout: installtoolsall # DO NOT MODIFY. Always true for tool install articles --- -[Sysbox](https://github.com/nestybox/sysbox/blob/master/README.md) enables you to use Docker containers for workloads that typically require virtual machines. Containers run with Sysbox are able to run software that relies on the [systemd System and Service Manager](https://systemd.io/) that is not usually present in containers, and it does this without the need for a full virtual machine and hardware emulation. +[Sysbox](https://github.com/nestybox/sysbox/blob/master/README.md) enables you to use Docker containers for workloads that typically require virtual machines. Containers run with Sysbox are able to run software that relies on the [systemd System and Service Manager](https://systemd.io/) that is not usually present in containers, and it does this without the need for a full virtual machine and hardware emulation. -Running Docker inside Docker, and Kubernetes inside Docker, are also Sysbox use cases. Without Sysbox, these are difficult because the Docker daemon requires systemd. +Running Docker inside Docker, and Kubernetes inside Docker, are also Sysbox use cases. Without Sysbox, these are difficult because the Docker daemon requires systemd. In summary, Sysbox is a powerful container runtime that provides many of the benefits of virtual machines without the overhead of running a full VM. It is good for workloads that require the ability to run system-level software. ## What do I need to run Sysbox? -Sysbox runs on Linux and supports Arm. +Sysbox runs on Linux and supports Arm. Sysbox has limited support for older versions of Linux, but recent Linux versions are easily compatible. If you are unsure about your Linux distribution and Linux kernel version, you can check [Sysbox Distro Compatibility](https://github.com/nestybox/sysbox/blob/master/docs/distro-compat.md) -Sysbox is a container runtime, and so Docker is required before installing Sysbox. +Sysbox is a container runtime, and so Docker is required before installing Sysbox. In most cases, you can install Docker on Arm Linux with the commands: @@ -52,15 +56,15 @@ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh sudo usermod -aG docker $USER ; newgrp docker ``` -Refer to the [Docker install guide](/install-guides/docker/docker-engine/) for more information. +Refer to the [Docker install guide](/install-guides/docker/docker-engine/) for more information. -You can use Sysbox on a virtual machine from a [cloud service provider](/learning-paths/servers-and-cloud-computing/intro/find-hardware/), a Raspberry Pi 5, or any other Arm Linux-based computer. +You can use Sysbox on a virtual machine from a [cloud service provider](/learning-paths/servers-and-cloud-computing/intro/find-hardware/), a Raspberry Pi 5, or any other Arm Linux-based computer. ## How do I install Sysbox? Download the Sysbox official package from [Sysbox Releases](https://github.com/nestybox/sysbox/releases/) -You can download the Debian package for Arm from the command line: +You can download the Debian package for Arm from the command line: ```bash wget https://downloads.nestybox.com/sysbox/releases/v0.6.4/sysbox-ce_0.6.4-0.linux_arm64.deb @@ -90,11 +94,11 @@ If Sysbox is running, you see the output: ## How can I get set up with Sysbox quickly? -You can try Sysbox by creating a container image that includes systemd and Docker. +You can try Sysbox by creating a container image that includes systemd and Docker. Use a text editor to copy the text below to a file named `Dockerfile`: -```console +```console {file_name="Dockerfile"} FROM ubuntu:24.04 RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections @@ -116,7 +120,7 @@ EXPOSE 22 ENTRYPOINT [ "/sbin/init", "--log-level=err" ] ``` -Notice that Docker and the SSH server are installed, and port 22 is open for SSH connections. +Notice that Docker and the SSH server are installed, and port 22 is open for SSH connections. Build a container image using `docker`: @@ -130,7 +134,7 @@ Use Sysbox as the container runtime to create a new container: docker run --runtime=sysbox-runc -it -P --hostname=sbox sysbox-test ``` -The animated output below shows the Linux init process running. You can log in with the password `ubuntu`, or change it in the Dockerfile above. +The animated output below shows the Linux init process running. You can log in with the password `ubuntu`, or change it in the Dockerfile above. You can use Docker inside the container and the SSH server operates as expected. Both are possible because systemd is running in the container. @@ -138,9 +142,9 @@ You can use Docker inside the container and the SSH server operates as expected. ## How can I use SSH to connect to a Sysbox container? -To connect using SSH, you can identify the IP address of your Sysbox container in two alternative ways, from inside the container, or from outside the container. +To connect using SSH, you can identify the IP address of your Sysbox container in two alternative ways, from inside the container, or from outside the container. -To find the IP address from inside the container use the `ifconfig` command: +To find the IP address from inside the container use the `ifconfig` command: ```console ifconfig @@ -168,11 +172,11 @@ ssh ubuntu@172.20.0.2 Log in using the same `ubuntu` username and password. -You can also use the `docker` command to identify the IP address and port from outside the container. +You can also use the `docker` command to identify the IP address and port from outside the container. Run the command below from another shell outside of the Sysbox container: -```console +```bash docker ps ``` @@ -199,4 +203,4 @@ You can exit the Sysbox container using: sudo halt ``` -Sysbox behaves like a virtual machine and you can use it to run applications that require system services normally not available in containers. It is useful for testing and development tasks because the container changes are not saved, meaning that you can create a clean testing environment simply by restarting the Sysbox container. +Sysbox behaves like a virtual machine and you can use it to run applications that require system services normally not available in containers. It is useful for testing and development tasks because the container changes are not saved, meaning that you can create a clean testing environment simply by restarting the Sysbox container. diff --git a/content/install-guides/terraform.md b/content/install-guides/terraform.md index 429327f595..fe14076589 100644 --- a/content/install-guides/terraform.md +++ b/content/install-guides/terraform.md @@ -23,13 +23,13 @@ tool_install: true weight: 1 --- -[Terraform](https://www.terraform.io/) automates cloud infrastructure. It is an infrastructure as code tool. +[Terraform](https://www.terraform.io/) automates cloud infrastructure. It is an infrastructure as code tool. -Terraform is available for Windows, macOS, Linux and supports the Arm architecture. +Terraform is available for Windows, macOS, Linux and supports the Arm architecture. ## Before you begin -[General installation information](https://developer.hashicorp.com/terraform/downloads) is available which covers all supported operating systems. +[General installation information](https://developer.hashicorp.com/terraform/downloads) is available which covers all supported operating systems. This article provides a quick solution to install Terraform for Ubuntu on Arm. @@ -46,9 +46,9 @@ If you see a different result, you are not using an Arm computer running 64-bit ## Download and Install -The easiest way to install Terraform for Ubuntu on Arm is to use the zip file and copy the executable. +The easiest way to install Terraform for Ubuntu on Arm is to use the zip file and copy the executable. -The installation options with the Ubuntu package manager at time of writing do not work well, but please try them as they may improve. +The installation options with the Ubuntu package manager at time of writing do not work well, but please try them as they may improve. Make sure `unzip`, `curl`, and `wget` are available. diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 0cfb11b489..2f5620a143 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -19,6 +19,10 @@ author_primary: Jason Andrews ### Link to official documentation official_docs: https://gitlab.arm.com/telemetry-solution/telemetry-solution +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -41,7 +45,7 @@ Follow the instructions below to install the Telemetry Solution on an Arm Linux 1. Confirm you are using an Arm machine by running: -```console +```bash uname -m ``` @@ -89,7 +93,7 @@ sudo pip3 install -e . {{% notice Note %}} If you are getting errors on the environment being externally managed, try creating a virtual environment. -``` +```bash sudo apt install python3-venv -y python3 -m venv topdown-venv source topdown-venv/bin/activate diff --git a/content/install-guides/vnc.md b/content/install-guides/vnc.md index ef9503ba9e..fd087ac2b1 100644 --- a/content/install-guides/vnc.md +++ b/content/install-guides/vnc.md @@ -13,9 +13,14 @@ minutes_to_complete: 30 author_primary: Jason Andrews + ### Link to official documentation official_docs: https://tigervnc.org/ +test_images: +- ubuntu:latest +test_maintenance: true + ### PAGE SETUP weight: 1 # Defines page ordering. Must be 1 for first (or only) page. tool_install: true # Set to true to be listed in main selection page, else false @@ -28,11 +33,11 @@ Virtual Network Computing (VNC) is one of the common tools used to connect to a This section provides info about how to setup VNC on a remote Arm Linux machine. -Feel free to seek out additional VNC tutorials or add more information to this page. +Feel free to seek out additional VNC tutorials or add more information to this page. This installation only works on newer versions of Ubuntu and Debian. It was successfully tested on **Ubuntu 22.04** and is known to fail on **Ubuntu 20.04**. -## VNC +## VNC VNC is a client server application. A VNC server runs on a remote machine. A VNC client runs on the local machine and connects to the remote server. @@ -40,7 +45,7 @@ VNC is a client server application. A VNC server runs on a remote machine. A VNC To use VNC, a VNC server needs to be installed. There are multiple VNC servers which can be used. This recipe uses [TigerVNC](https://tigervnc.org/). -Desktop software is also needed. There are many options for this, but using [xfce4](https://www.xfce.org/) makes for a minimal install with good performance. +Desktop software is also needed. There are many options for this, but using [xfce4](https://www.xfce.org/) makes for a minimal install with good performance. Install the desktop software. @@ -62,7 +67,7 @@ Run the password command to set a password for VNC. This is not the password for vncpasswd ``` -Remember the password for later when the client is connected. +Remember the password for later when the client is connected. ### Configure the desktop startup @@ -75,7 +80,7 @@ unset DBUS_SESSION_BUS_ADDRESS exec startxfce4 ``` Make sure the `xstartup` file has executable permission. -```bash +```console chmod +x $HOME/.vnc/xstartup ``` @@ -119,14 +124,14 @@ sudo systemctl stop vncserver@1.service To restart the VNC service: ```console -sudo systemctl restart vncserver@1.service +sudo systemctl restart vncserver@1.service ``` ### Use port forwarding via SSH to connect -The default port for the first instance of VNC is `5901`. SSH port forwarding is the best solution for accessing the Linux desktop on a cloud machine. This way no additional ports need to be opened in the security group. +The default port for the first instance of VNC is `5901`. SSH port forwarding is the best solution for accessing the Linux desktop on a cloud machine. This way no additional ports need to be opened in the security group. -SSH to your remote Linux machine. Refer to [SSH](/install-guides/ssh/) for additional details. +SSH to your remote Linux machine. Refer to [SSH](/install-guides/ssh/) for additional details. Substitute your private key file and public IP address of the remote machine. @@ -142,6 +147,6 @@ localhost:5901 ``` You will be prompted for the password created earlier with `vncpasswd`. -A remote Linux Desktop should appear on your local computer. Make sure to close the VNC client first and then exit the SSH connection. +A remote Linux Desktop should appear on your local computer. Make sure to close the VNC client first and then exit the SSH connection. ![Linux desktop #center](/install-guides/_images/xfce4.png) From f51cd881601123b27b9364472617315b746e4480 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 13:35:32 +0100 Subject: [PATCH 060/185] Address errors in test suite --- content/install-guides/rust.md | 2 +- content/install-guides/rust_embedded.md | 2 +- content/install-guides/streamline-cli.md | 11 ++++++----- content/install-guides/sysbox.md | 2 +- content/install-guides/topdown-tool.md | 2 +- tools/check.py | 3 ++- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/content/install-guides/rust.md b/content/install-guides/rust.md index 029bb11df7..335f04f5ca 100644 --- a/content/install-guides/rust.md +++ b/content/install-guides/rust.md @@ -63,7 +63,7 @@ These Linux distributions use `yum` as the package manager. Use the `yum` command to install the required software packages. If the machine has `sudo` you can use it. -```bash { target="fedora:latest" } +```console sudo yum update -y sudo yum install -y curl gcc ``` diff --git a/content/install-guides/rust_embedded.md b/content/install-guides/rust_embedded.md index 95ec0547af..7d6c7e5004 100644 --- a/content/install-guides/rust_embedded.md +++ b/content/install-guides/rust_embedded.md @@ -36,7 +36,7 @@ For a thorough review of all options, refer to the official documentation. See [ Run the following command to download and install Rust: ```bash -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -y | sh ``` Start a new shell or run the following command to continue: diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 11ea2244be..337ecb5e98 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -77,8 +77,8 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati 1. Download and extract the Streamline CLI tools on your Arm server: ```bash -wget https://artifacts.tools.arm.com/arm-performance-studio/2024.3/Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  -tar -xzf Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  +wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz +tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz  ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: @@ -86,7 +86,8 @@ tar -xzf Arm_Streamline_CLI_Tools_9.2.2_linux_arm64.tgz  ```bash python3 -m venv sl-venv source ./sl-venv/bin/activate -python3 -m pip install -r ./streamline_cli_tools/bin/requirements.txt +cd streamline_cli_tools +python3 -m pip install -r bin/requirements.txt ``` {{% notice Note%}} @@ -121,13 +122,13 @@ You might need to adapt them slightly to other Linux distributions. To apply the patch to the latest 6.7 kernel, you can use `git`: ```bash -git apply v6.7-combined.patch +git apply patch/v6.7-combined.patch ``` or `patch`: ```bash -patch -p 1 -i v6.7-combined.patch +patch -p 1 -i patch/v6.7-combined.patch ``` ### Manual application to an RPM-based distribution diff --git a/content/install-guides/sysbox.md b/content/install-guides/sysbox.md index 33ad7876ec..f122e8e40c 100644 --- a/content/install-guides/sysbox.md +++ b/content/install-guides/sysbox.md @@ -131,7 +131,7 @@ docker build -t sysbox-test -f Dockerfile . Use Sysbox as the container runtime to create a new container: ```bash -docker run --runtime=sysbox-runc -it -P --hostname=sbox sysbox-test +docker run --runtime=sysbox-runc -P --hostname=sbox sysbox-test ``` The animated output below shows the Linux init process running. You can log in with the password `ubuntu`, or change it in the Dockerfile above. diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 2f5620a143..bb2c4ace1c 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -80,7 +80,6 @@ sudo apt install python3-pip python-is-python3 -y ```bash { target="ubuntu:latest" } git clone https://git.gitlab.arm.com/telemetry-solution/telemetry-solution.git -cd telemetry-solution/tools/topdown_tool ``` 2. Install the `topdown-tool` executable: @@ -94,6 +93,7 @@ sudo pip3 install -e . {{% notice Note %}} If you are getting errors on the environment being externally managed, try creating a virtual environment. ```bash +cd telemetry-solution/tools/topdown_tool sudo apt install python3-venv -y python3 -m venv topdown-venv source topdown-venv/bin/activate diff --git a/tools/check.py b/tools/check.py index 8d4f20fc17..52fce97ebb 100644 --- a/tools/check.py +++ b/tools/check.py @@ -282,8 +282,9 @@ def check(json_file, start, stop, md_article): if paths_to_remove: logging.info(f"Removing files that was created during testing from repository") for path in paths_to_remove: - if os.path.isfile(path): + if os.path.isfile(path) or os.path.islink(path): os.remove(path) + elif os.path.isdir(path): shutil.rmtree(path) logging.debug(f"Removed {path}") From a219faad72a69b3fff07cc11fbb4891a397d2733 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 13:52:18 +0100 Subject: [PATCH 061/185] Address errors in test suite --- content/install-guides/sysbox.md | 2 +- content/install-guides/vnc.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/sysbox.md b/content/install-guides/sysbox.md index f122e8e40c..b384e4a9a0 100644 --- a/content/install-guides/sysbox.md +++ b/content/install-guides/sysbox.md @@ -130,7 +130,7 @@ docker build -t sysbox-test -f Dockerfile . Use Sysbox as the container runtime to create a new container: -```bash +```console docker run --runtime=sysbox-runc -P --hostname=sbox sysbox-test ``` diff --git a/content/install-guides/vnc.md b/content/install-guides/vnc.md index fd087ac2b1..c0cd7db61f 100644 --- a/content/install-guides/vnc.md +++ b/content/install-guides/vnc.md @@ -63,7 +63,7 @@ sudo apt-get install tigervnc-standalone-server tigervnc-common -y Run the password command to set a password for VNC. This is not the password for the user account, just for the VNC client to connect to the VNC server. -```bash +```console vncpasswd ``` From 323915d3b13f8280af967f9df8b9c6f7e1cade34 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 14:12:59 +0100 Subject: [PATCH 062/185] Address errors in test suite --- content/install-guides/streamline-cli.md | 2 +- content/install-guides/topdown-tool.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 337ecb5e98..f2b96b3a04 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -78,7 +78,7 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati ```bash wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz  +sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz  ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index bb2c4ace1c..1aae132931 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -86,7 +86,7 @@ git clone https://git.gitlab.arm.com/telemetry-solution/telemetry-solution.git Install `topdown-tool` in `/usr/local/bin` using: -```console +```bash sudo pip3 install -e . ``` @@ -97,7 +97,6 @@ cd telemetry-solution/tools/topdown_tool sudo apt install python3-venv -y python3 -m venv topdown-venv source topdown-venv/bin/activate -pip3 install -e . ``` {{% /notice %}} From 8f5bd1ae41368ecb2c6bb6551f3e000438abfc32 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 14:25:38 +0100 Subject: [PATCH 063/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index f2b96b3a04..be24f7a689 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -78,6 +78,7 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati ```bash wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz +chmod +x Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz  ``` From 4cf97fbdbb975b09d0f2b19f560a4018a1615743 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 08:15:06 +0100 Subject: [PATCH 064/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index be24f7a689..5268da6f00 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -77,8 +77,8 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati 1. Download and extract the Streamline CLI tools on your Arm server: ```bash +sudo apt-get install bzip2 wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -chmod +x Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz  ``` From 360bdbde470cf5f2e99d3e3a5b2532e7ee1a83a4 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 08:53:53 +0100 Subject: [PATCH 065/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 5268da6f00..c25ef92f9a 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -78,8 +78,8 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati ```bash sudo apt-get install bzip2 -wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz  +wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P . +sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: From aebf8da57d9f50908e58837f832c76b2ed497072 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 09:04:05 +0100 Subject: [PATCH 066/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index c25ef92f9a..671f450d78 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -84,10 +84,9 @@ sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: -```bash +```bash { cwd="$HOME/streamline_cli_tools" } python3 -m venv sl-venv source ./sl-venv/bin/activate -cd streamline_cli_tools python3 -m pip install -r bin/requirements.txt ``` @@ -122,13 +121,13 @@ You might need to adapt them slightly to other Linux distributions. To apply the patch to the latest 6.7 kernel, you can use `git`: -```bash +```bash { cwd="$HOME/streamline_cli_tools" } git apply patch/v6.7-combined.patch ``` or `patch`: -```bash +```bash { cwd="$HOME/streamline_cli_tools" } patch -p 1 -i patch/v6.7-combined.patch ``` From 5647ff0de931977fa4b7e700fbf989529be7371d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 10:26:46 +0100 Subject: [PATCH 067/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 1 - tools/check.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 671f450d78..e007102dea 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -77,7 +77,6 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati 1. Download and extract the Streamline CLI tools on your Arm server: ```bash -sudo apt-get install bzip2 wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P . sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz ``` diff --git a/tools/check.py b/tools/check.py index 52fce97ebb..b8bfea10a8 100644 --- a/tools/check.py +++ b/tools/check.py @@ -86,7 +86,7 @@ def write_commands_to_file(test_cmd_filename, test): # - An environment variable is specified cmd_args = { "env_source":"source", - "cwd":"cwd", + "cwd":"cd", "env":"export" } for cmd_arg in cmd_args.keys(): From 5fae7f3d1e0a8ae627449256a7a9ec67b3b8485e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 11:16:48 +0100 Subject: [PATCH 068/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 2 +- tools/check.py | 2 +- tools/parse.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index e007102dea..bcb6a1b784 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -78,7 +78,7 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati ```bash wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P . -sudo tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz +tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: diff --git a/tools/check.py b/tools/check.py index b8bfea10a8..e1d880dec3 100644 --- a/tools/check.py +++ b/tools/check.py @@ -86,7 +86,7 @@ def write_commands_to_file(test_cmd_filename, test): # - An environment variable is specified cmd_args = { "env_source":"source", - "cwd":"cd", + "cwd":"cd ", "env":"export" } for cmd_arg in cmd_args.keys(): diff --git a/tools/parse.py b/tools/parse.py index edfcd65204..b23ae2fbba 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -170,6 +170,7 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): continue cmd_lines_header = cmd_lines[0] + logging.debug(cmd_lines_header) # if fvp type, check for arguments if "fvp" in cmd_lines_header: content[cmd_idx] = {"type": "fvp"} @@ -188,7 +189,7 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): content[cmd_idx] = {"type": "bash"} for arg in arg_list: if arg in cmd_str: - arg_str = cmd_str.split(arg)[1].split("\"")[0] + arg_str = cmd_str.split(arg)[1].split("\"")[1] content[cmd_idx].update({arg:arg_str}) if "|" in cmd_lines_header: expected_result = cmd_str.split("| ")[1].split("}")[0].split("-") From 630e2a653e00ee4a82a6fb294981bdd8514eb345 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 11:20:16 +0100 Subject: [PATCH 069/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index bcb6a1b784..2d12e4e09f 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -77,8 +77,8 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati 1. Download and extract the Streamline CLI tools on your Arm server: ```bash -wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P . -tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz +wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P $HOME +tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: From e0201bb425477c01911ab1098e4df1c32db33d4a Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 11:22:43 +0100 Subject: [PATCH 070/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 2d12e4e09f..a82ed0f3a4 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -78,7 +78,7 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati ```bash wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P $HOME -tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME +tar -xzf $HOME/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: From c4097e4fa428ac2f8a0d5abe97832ebe90b1341c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 13:38:33 +0100 Subject: [PATCH 071/185] Debug check.py --- tools/check.py | 5 +++-- tools/parse.py | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/check.py b/tools/check.py index e1d880dec3..7ec9399bc6 100644 --- a/tools/check.py +++ b/tools/check.py @@ -86,14 +86,15 @@ def write_commands_to_file(test_cmd_filename, test): # - An environment variable is specified cmd_args = { "env_source":"source", - "cwd":"cd ", + "cwd":"cd", "env":"export" } for cmd_arg in cmd_args.keys(): if cmd_arg in test: # Retrieve the command as string cmd_arg_test = test[cmd_arg] if isinstance(test[cmd_arg], str) else test[cmd_arg][0] - cmd = cmd_args[cmd_arg] + cmd_arg_test + cmd = cmd_args[cmd_arg] + " " + cmd_arg_test + logging.debug(f"FINAL COMMAND: {cmd}") write_cmd_to_file(f, test_cmd_filename, cmd) # Check if commands need to be run before the test diff --git a/tools/parse.py b/tools/parse.py index b23ae2fbba..a713253c26 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -170,7 +170,6 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): continue cmd_lines_header = cmd_lines[0] - logging.debug(cmd_lines_header) # if fvp type, check for arguments if "fvp" in cmd_lines_header: content[cmd_idx] = {"type": "fvp"} @@ -185,10 +184,10 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): content[cmd_idx].update({"fvp_name": "FVP_Corstone_SSE-300_Ethos-U55" }) # if bash type, check for arguments elif "bash" in cmd_lines_header: - arg_list = ["ret_code", "env_source", "env=", "pre_cmd", "cwd", "target"] + arg_list = ["ret_code", "env_source", "env", "pre_cmd", "cwd", "target"] content[cmd_idx] = {"type": "bash"} for arg in arg_list: - if arg in cmd_str: + if arg in cmd_lines_header: arg_str = cmd_str.split(arg)[1].split("\"")[1] content[cmd_idx].update({arg:arg_str}) if "|" in cmd_lines_header: From 1c548503a3a41d4bda0d8db010f90d752571c33c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 14:08:09 +0100 Subject: [PATCH 072/185] Update streamline-cli.md --- content/install-guides/streamline-cli.md | 4 ++-- tools/parse.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index a82ed0f3a4..8356ba788c 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -120,13 +120,13 @@ You might need to adapt them slightly to other Linux distributions. To apply the patch to the latest 6.7 kernel, you can use `git`: -```bash { cwd="$HOME/streamline_cli_tools" } +```console git apply patch/v6.7-combined.patch ``` or `patch`: -```bash { cwd="$HOME/streamline_cli_tools" } +```console patch -p 1 -i patch/v6.7-combined.patch ``` diff --git a/tools/parse.py b/tools/parse.py index a713253c26..c9361d7bfd 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -184,7 +184,8 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): content[cmd_idx].update({"fvp_name": "FVP_Corstone_SSE-300_Ethos-U55" }) # if bash type, check for arguments elif "bash" in cmd_lines_header: - arg_list = ["ret_code", "env_source", "env", "pre_cmd", "cwd", "target"] + # Equal sign on env so that it's not picked up by env_source + arg_list = ["ret_code", "env_source", "env=", "pre_cmd", "cwd", "target"] content[cmd_idx] = {"type": "bash"} for arg in arg_list: if arg in cmd_lines_header: From c19855fde980de3e9a54f88409da2820f2bb0687 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 14:21:48 +0100 Subject: [PATCH 073/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 1aae132931..3265736ebb 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -87,13 +87,13 @@ git clone https://git.gitlab.arm.com/telemetry-solution/telemetry-solution.git Install `topdown-tool` in `/usr/local/bin` using: ```bash +cd telemetry-solution/tools/topdown_tool sudo pip3 install -e . ``` {{% notice Note %}} If you are getting errors on the environment being externally managed, try creating a virtual environment. ```bash -cd telemetry-solution/tools/topdown_tool sudo apt install python3-venv -y python3 -m venv topdown-venv source topdown-venv/bin/activate From 4c9b1eccb2a470228ca0c25da87c6bfb356207d8 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 15:22:33 +0100 Subject: [PATCH 074/185] Update stats_current_test_info.yml --- data/stats_current_test_info.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index 92314bfdab..a27a3d408c 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -142,10 +142,38 @@ sw_categories: readable_title: PyTorch tests_and_status: - ubuntu:latest: passed + rust: + readable_title: Rust for Linux Applications + tests_and_status: + - ubuntu:latest: passed + rust_embedded: + readable_title: Rust for Embedded Applications + tests_and_status: + - ubuntu:latest: passed + ssh: + readable_title: SSH + tests_and_status: + - ubuntu:latest: passed + streamline-cli: + readable_title: Streamline CLI Tools + tests_and_status: + - ubuntu:latest: passed + sysbox: + readable_title: Sysbox + tests_and_status: + - ubuntu:latest: passed terraform: readable_title: Terraform tests_and_status: - ubuntu:latest: passed + topdown-tool: + readable_title: Telemetry Solution (Topdown Methodology) + tests_and_status: + - ubuntu:latest: passed + vnc: + readable_title: VNC on Arm Linux + tests_and_status: + - ubuntu:latest: passed laptops-and-desktops: {} microcontrollers: tfm: From 158695a12579531844d5cc52ee9820abfb7326e7 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 15 Nov 2024 09:51:34 +0100 Subject: [PATCH 075/185] Minor cleanup of test framework --- .github/workflows/test-lp.yml | 1 - .../_example-learning-path/appendix-3-test.md | 21 +++++++++++++++---- data/stats_current_test_info.yml | 2 +- tools/check.py | 2 +- tools/patch.py | 1 - 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index e75bca257a..0e5e397718 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -10,7 +10,6 @@ jobs: id: changed-markdown-files uses: tj-actions/changed-files@v44 with: - # Avoid using single or double quotes for multiline patterns files: | **.md - name: Install dependencies diff --git a/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md b/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md index 190da68f80..a95c3d1dcc 100644 --- a/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md +++ b/content/learning-paths/cross-platform/_example-learning-path/appendix-3-test.md @@ -72,7 +72,7 @@ If a specific return code is expected, it can be specified as follows: #### Command output -You can display the shell which the command should run in by specifying the `command_line` option. You can also test for expected output in the instructions by specifying the line(s) where the expected output should be displayed. This is done by adding the pipe symbol (`|`). Since the first line should contain the command itself, the indexing of the expected output lines starts at 2. You can specify a span (if the expected output is more than one line) with the dash symbol, for example `"| 2-10"`. +You can visualize the shell by specifying the `command_line` option. You can also test for expected output in the instructions by specifying the line(s) where the expected output should be displayed. This is done by adding the pipe symbol (`|`). Since the first line should contain the command itself, the indexing of the expected output lines starts at 2. You can specify a span (if the expected output is more than one line) with the dash symbol, for example `"| 2-10"`. ```markdown Let's check is this command return the expected output: @@ -223,7 +223,7 @@ The `test_images` field is a list of Docker container images the framework can p From the project root folder, run: ```bash -./tools/maintenance.py -i content/learning-paths/servers-and-cloud-computing/mynewlearningpath +./tools/maintenance.py -i content/learning-paths/microcontrollers/my-new-learning-path ``` If the Learning Path contains sub-articles, the framework will run their instructions in order, depending on the sub-articles weight. @@ -238,7 +238,7 @@ If the tests are successful, that will be communicated through the console. ### Investigating failures -The framework will print information about any errors to the console. For a more refined analysis, add the `--debug` flag. +The framework will print information about any errors to the console. To display additional output, run with the `--debug` flag. ```bash ./tools/maintenance.py -i content/install-guides/mytool.md --debug @@ -247,7 +247,20 @@ The framework will print information about any errors to the console. For a more ### Saving the results -If you want the results to be saved, add the `--stats-report` flag to the command. This will update a statistics file which publishes the result to the website. +If you want the results to be saved, add the `--stats-report` flag to the command. This will update a statistics file `stats_current_test_info.yml`, which publishes the result to the website. In order to do that, the Learning Path or Install Guide needs to exist as an entry in the statistics file. Find the category for your content. If it's an Install Guide, the name will be that of the .md file without the extension. If it's a Learning Path, you will use the name of the directory. For example: + +``` +install-guides: + mytool: + readable_title: My Tool + tests_and_status: + - ubuntu:latest: passed +microcontrollers: + my-new-learning-path: + readable_title: My new Learning Path + tests_and_status: + - ubuntu:latest: passed +``` ```bash ./tools/maintenance.py -i content/install-guides/mytool.md --stats-report diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index a27a3d408c..d3897a8598 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -70,7 +70,7 @@ sw_categories: tests_and_status: - ubuntu:latest: passed aws-copilot: - readable_title: AWS CLI + readable_title: AWS Copilot CLI tests_and_status: - ubuntu:latest: passed azure-cli: diff --git a/tools/check.py b/tools/check.py index 7ec9399bc6..a6ba671e1d 100644 --- a/tools/check.py +++ b/tools/check.py @@ -281,7 +281,7 @@ def check(json_file, start, stop, md_article): and "test-lp-output.txt" not in file_name ] if paths_to_remove: - logging.info(f"Removing files that was created during testing from repository") + logging.info(f"Removing files that were created during testing from repository") for path in paths_to_remove: if os.path.isfile(path) or os.path.islink(path): os.remove(path) diff --git a/tools/patch.py b/tools/patch.py index 95463c18fe..36513cf7c1 100644 --- a/tools/patch.py +++ b/tools/patch.py @@ -14,7 +14,6 @@ def patch(article_path: str, results: dict, link: str): f.close() article_path_pure = PurePath(re.sub(r"^.*?content/", "", article_path)) - print(article_path_pure) article_path_parts = list(article_path_pure.parts) if "learning-paths" in article_path_parts: content_type, sw_category, content_title = article_path_parts From 5c2aa7cb9d92eeb86581e3134e50e2abbfb59559 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 18 Nov 2024 09:55:16 +0100 Subject: [PATCH 076/185] Update anaconda.md --- .github/workflows/test_lp.sh | 2 +- content/install-guides/anaconda.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index e7cac12f88..e6d24f1c0d 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -19,5 +19,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} + tools/maintenance.py -i ${file} --stats-report done diff --git a/content/install-guides/anaconda.md b/content/install-guides/anaconda.md index 6b992aa4b0..58b9eb97ab 100644 --- a/content/install-guides/anaconda.md +++ b/content/install-guides/anaconda.md @@ -22,11 +22,11 @@ tool_install: true weight: 1 --- -[Anaconda Distribution](https://www.anaconda.com/products/distribution) is a popular open-source Python distribution. +[Anaconda Distribution](https://www.anaconda.com/products/distribution) is a popular open-source Python distribution. It includes access to a repository with over 8,000 open-source data science and machine learning packages. -The `conda` command can be used to quickly install and use Python packages. +The `conda` command can be used to quickly install and use Python packages. Follow the instructions below to install and use Anaconda Distribution on an Arm server. @@ -46,11 +46,11 @@ aarch64 If you see a different result, you are not using an Arm computer running 64-bit Linux. -The installer requires some desktop related libraries. The dependencies can be met by installing a desktop environment. +The installer requires some desktop related libraries. The dependencies can be met by installing a desktop environment. For Ubuntu/Debian, run the command: -```console +```bash sudo apt install xfce4 -y ``` @@ -60,7 +60,7 @@ For Amazon Linux, run the command: sudo amazon-linux-extras install mate-desktop1.x ``` -## How do I download the latest Anaconda distribution? +## How do I download the latest Anaconda distribution? To download the latest Anaconda distribution, run: @@ -84,7 +84,7 @@ sh ./Anaconda3-2023.09-0-Linux-aarch64.sh -b The install takes a couple of minutes to complete. -The batch installation will not set up the shell. +The batch installation will not set up the shell. To set up the shell, run: @@ -133,7 +133,7 @@ Run the example code: python ./tf.py ``` -The expected output format is below. Your version may be slightly different. +The expected output format is below. Your version may be slightly different. ```output 2.12.0 @@ -180,6 +180,6 @@ tensor([[0.9287, 0.5931, 0.0239], ``` -You are ready to use Anaconda Distribution. +You are ready to use Anaconda Distribution. Explore the many machine learning articles and examples using TensorFlow and PyTorch. From a84e10b874f997b67180fdee39453256a629b53b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 18 Nov 2024 10:23:55 +0100 Subject: [PATCH 077/185] Update anaconda.md --- content/install-guides/anaconda.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/install-guides/anaconda.md b/content/install-guides/anaconda.md index 58b9eb97ab..fbcd035dec 100644 --- a/content/install-guides/anaconda.md +++ b/content/install-guides/anaconda.md @@ -51,6 +51,7 @@ The installer requires some desktop related libraries. The dependencies can be m For Ubuntu/Debian, run the command: ```bash +sudo apt update sudo apt install xfce4 -y ``` From 439438042e07d3c29845a38297238212259f99e9 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 18 Nov 2024 10:46:58 +0100 Subject: [PATCH 078/185] Update test-lp.yml --- .github/workflows/test-lp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 0e5e397718..76b913da8e 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -15,7 +15,6 @@ jobs: - name: Install dependencies if: steps.changed-markdown-files.outputs.any_changed == 'true' run: pip install -r tools/requirements.txt - - name: Run test suite for all changed files id: run-suite if: steps.changed-markdown-files.outputs.any_changed == 'true' @@ -47,7 +46,7 @@ jobs: run: echo "Maintenance is turned off for one or more files" - name: Create Pull Request uses: peter-evans/create-pull-request@v6 - if: success() && steps.maintenance-state.outputs.MAINTENANCE == 'on' + if: success() && env.MAINTENANCE == 'on' with: commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml From 29d82b0fab8c289396df8694e0d9beb41b421bd4 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 14:37:10 +0100 Subject: [PATCH 079/185] Update workflow permissions --- .github/workflows/test-lp.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 76b913da8e..33929dc270 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,5 +1,8 @@ name: Test Learning Path on: pull_request +permissions: + contents: write + pull-requests: write jobs: Test-Pull-Request: runs-on: arm-linux-runner @@ -48,6 +51,7 @@ jobs: uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' with: + token: GITHUB_TOKEN commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | From 905967ffee1c179d895098a3c5e5d9e95d387bfa Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 14:57:45 +0100 Subject: [PATCH 080/185] Update GITHUB_TOKEN --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 33929dc270..2d0505654b 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -51,7 +51,7 @@ jobs: uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' with: - token: GITHUB_TOKEN + token: ${{ GITHUB_TOKEN }} commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | From 8669139eafbc5caffb1baaff118fbe379d51bb8d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 14:59:46 +0100 Subject: [PATCH 081/185] Update github.token --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 2d0505654b..8b5b01265d 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -51,7 +51,7 @@ jobs: uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' with: - token: ${{ GITHUB_TOKEN }} + token: ${{ github.token }} commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | From 8968d31222427095dbd31af71be0037de62c3376 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 15:12:37 +0100 Subject: [PATCH 082/185] Remove github.token --- .github/workflows/test-lp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 8b5b01265d..6d19443860 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -51,7 +51,6 @@ jobs: uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' with: - token: ${{ github.token }} commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | From 9c93004ab7bd330e9131f3abe9129c2829cb996f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 16:53:32 +0100 Subject: [PATCH 083/185] Disable --stats-report --- .github/workflows/test_lp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index e6d24f1c0d..e7cac12f88 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -19,5 +19,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} --stats-report + tools/maintenance.py -i ${file} done From dd73ea42ffdc2a431c87e51b429ed6c88ad9cd27 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 17:07:04 +0100 Subject: [PATCH 084/185] Update GITHUB_TOKEN --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 6d19443860..59fdf9df0b 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -51,6 +51,7 @@ jobs: uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' with: + token: ${{ secrets.GITHUB_TOKEN }} commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | From 94b3fd9585c33bd736700232bd1454a68e4917bc Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 25 Nov 2024 17:15:03 +0100 Subject: [PATCH 085/185] Change base in workflow job --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 59fdf9df0b..831baf70d5 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -58,4 +58,4 @@ jobs: Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request branch: update-stats - base: main \ No newline at end of file + base: ${{ github.head_ref }} \ No newline at end of file From 28e48fde0cf1912d963e4a9a6cbdab9c008ce626 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 26 Nov 2024 09:22:57 +0100 Subject: [PATCH 086/185] Enable --stats-report --- .github/workflows/test_lp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index e7cac12f88..e6d24f1c0d 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -19,5 +19,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} + tools/maintenance.py -i ${file} --stats-report done From 993260ffa1ab21647c23480d630c2b98e110d084 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 10 Jan 2025 11:30:18 +0100 Subject: [PATCH 087/185] Trigger re-run of tests --- .github/workflows/test_lp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh index e6d24f1c0d..3331f07c12 100755 --- a/.github/workflows/test_lp.sh +++ b/.github/workflows/test_lp.sh @@ -18,6 +18,7 @@ done CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests + for file in ${CONTENT_PATHS_UNIQUE[*]}; do tools/maintenance.py -i ${file} --stats-report done From 62da66da3b6b3cd136799f7981e5305d2c0777eb Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 08:51:03 +0100 Subject: [PATCH 088/185] Don't specify PR branch --- .github/workflows/test-lp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 831baf70d5..9afd625bca 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -57,5 +57,4 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: update-stats - base: ${{ github.head_ref }} \ No newline at end of file + branch: update-stats \ No newline at end of file From 7b73bcf48ebf3e9f794f2404d84172ff9ab6d681 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 09:08:34 +0100 Subject: [PATCH 089/185] Specify main branch --- .github/workflows/test-lp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 9afd625bca..59fdf9df0b 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -57,4 +57,5 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: update-stats \ No newline at end of file + branch: update-stats + base: main \ No newline at end of file From 29c3d11ecbc8b56d232f8856cdd1c0840757643c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 09:17:44 +0100 Subject: [PATCH 090/185] Token to default, add pages write permissions --- .github/workflows/test-lp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 59fdf9df0b..e317c6373b 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -2,7 +2,7 @@ name: Test Learning Path on: pull_request permissions: contents: write - pull-requests: write + pages: write jobs: Test-Pull-Request: runs-on: arm-linux-runner @@ -51,7 +51,6 @@ jobs: uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' with: - token: ${{ secrets.GITHUB_TOKEN }} commit-message: update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | From a8cd8d3a628a193ca180c1789df9e97c869fd4b4 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 09:29:55 +0100 Subject: [PATCH 091/185] Use head_ref as 'branch' --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index e317c6373b..099056fefc 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -56,5 +56,5 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: update-stats + branch: ${{ github.head_ref }} base: main \ No newline at end of file From cb027a5b4384b6b9884f96ea7cf4c9ff4a350724 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 09:41:11 +0100 Subject: [PATCH 092/185] Use default branches --- .github/workflows/test-lp.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 099056fefc..6c269112a8 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -2,7 +2,7 @@ name: Test Learning Path on: pull_request permissions: contents: write - pages: write + pull-requests: write jobs: Test-Pull-Request: runs-on: arm-linux-runner @@ -55,6 +55,4 @@ jobs: title: Update stats_current_test_info.yml body: | Update test result file with recent run - Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: ${{ github.head_ref }} - base: main \ No newline at end of file + Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request \ No newline at end of file From d3fafea56a5a64b75edf897d5eecd9f5747bdb3b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 13:32:44 +0100 Subject: [PATCH 093/185] Specify branch as workflow variable --- .github/workflows/test-lp.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 6c269112a8..4e9f161285 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,8 +1,5 @@ name: Test Learning Path on: pull_request -permissions: - contents: write - pull-requests: write jobs: Test-Pull-Request: runs-on: arm-linux-runner @@ -55,4 +52,5 @@ jobs: title: Update stats_current_test_info.yml body: | Update test result file with recent run - Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request \ No newline at end of file + Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request + branch: ${{ steps.vars.outputs.branch-name }} \ No newline at end of file From 77058e5aab90f35982fc9bfdd83823bad89cfbec Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 13:39:23 +0100 Subject: [PATCH 094/185] Specify base --- .github/workflows/test-lp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 4e9f161285..a4c59f364c 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -53,4 +53,5 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: ${{ steps.vars.outputs.branch-name }} \ No newline at end of file + branch: ${{ steps.vars.outputs.branch-name }} + base: ${{ steps.vars.outputs.base }} \ No newline at end of file From 0c6ec48f9b6e9400a5efd06bbf6acb39352a48f6 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 13 Jan 2025 13:48:25 +0100 Subject: [PATCH 095/185] Change order of arguments --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index a4c59f364c..eadfb1ed81 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -53,5 +53,5 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request + base: ${{ steps.vars.outputs.base }} branch: ${{ steps.vars.outputs.branch-name }} - base: ${{ steps.vars.outputs.base }} \ No newline at end of file From 9d78078636ad8916db3826ca887b7fac5e6d62e9 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 13:43:51 +0100 Subject: [PATCH 096/185] Workaround by checking out main repository --- .github/workflows/test-lp.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index eadfb1ed81..50186273d7 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -6,6 +6,8 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 + with: + path: ${{ github.head_ref }} - name: Get all changed markdown files id: changed-markdown-files uses: tj-actions/changed-files@v44 @@ -44,6 +46,31 @@ jobs: if: env.MAINTENANCE == 'off' && success() # Skip opening a PR if tests have not been run run: echo "Maintenance is turned off for one or more files" + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + if: success() && env.MAINTENANCE == 'on' + with: + name: data/stats_current_test_info.yml + path: stats_current_test_info.yml + - name: Checkout tools repo + uses: actions/checkout@v4 + if: success() && env.MAINTENANCE == 'on' + with: + repository: ArmDeveloperEcosystem/native-runner-arm-learning-paths + path: native-runner-arm-learning-paths + - name: Download a single artifact + uses: actions/download-artifact@v4 + if: success() && env.MAINTENANCE == 'on' + with: + name: stats_current_test_info.yml + path: data/stats_current_test_info.yml + - name: Add changes to main + if: success() && env.MAINTENANCE == 'on' + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add data/stats_current_test_info.yml + git commit -m "Update stats_current_test_info.yml" - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' @@ -53,5 +80,5 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - base: ${{ steps.vars.outputs.base }} - branch: ${{ steps.vars.outputs.branch-name }} + base: ${{ github.repository }} + branch: main From 86f4178289156e8cb4b743d485550cc1e336682b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 13:52:20 +0100 Subject: [PATCH 097/185] Update primary branch name --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 50186273d7..ddce08593a 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -7,7 +7,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 with: - path: ${{ github.head_ref }} + path: ${{ steps.vars.outputs.branch-name }} - name: Get all changed markdown files id: changed-markdown-files uses: tj-actions/changed-files@v44 From c8b37009a567413751a60d8a8d198adc67474d4e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 13:59:05 +0100 Subject: [PATCH 098/185] Fix artifact path --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index ddce08593a..cd2c157b1c 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -50,8 +50,8 @@ jobs: uses: actions/upload-artifact@v4 if: success() && env.MAINTENANCE == 'on' with: - name: data/stats_current_test_info.yml - path: stats_current_test_info.yml + name: stats_current_test_info.yml + path: data/stats_current_test_info.yml - name: Checkout tools repo uses: actions/checkout@v4 if: success() && env.MAINTENANCE == 'on' From 1a56f85dfe90931c20d4c0df892865b65bd661e2 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 14:19:56 +0100 Subject: [PATCH 099/185] Upzip artifact --- .github/workflows/test-lp.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index cd2c157b1c..7c0f8c6384 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -50,7 +50,7 @@ jobs: uses: actions/upload-artifact@v4 if: success() && env.MAINTENANCE == 'on' with: - name: stats_current_test_info.yml + name: stats_current_test_info path: data/stats_current_test_info.yml - name: Checkout tools repo uses: actions/checkout@v4 @@ -62,11 +62,13 @@ jobs: uses: actions/download-artifact@v4 if: success() && env.MAINTENANCE == 'on' with: - name: stats_current_test_info.yml - path: data/stats_current_test_info.yml + name: stats_current_test_info + path: data/stats_current_test_info.zip - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | + unzip -o data/stats_current_test_info.zip + rm data/stats_current_test_info.zip git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git add data/stats_current_test_info.yml From e7bf8c5d1977f8ccd7b3ec429502151ef71d6df2 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 14:27:24 +0100 Subject: [PATCH 100/185] debug filename --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 7c0f8c6384..a3d1aa0edf 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,6 +67,7 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | + ls -l data/ unzip -o data/stats_current_test_info.zip rm data/stats_current_test_info.zip git config --global user.email "github-actions[bot]@users.noreply.github.com" From bee92f65bb014339029fade2c17497c4500d6dd3 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 14:40:48 +0100 Subject: [PATCH 101/185] Test permission of artifact --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index a3d1aa0edf..e7a4f99db7 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,8 +67,8 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - ls -l data/ - unzip -o data/stats_current_test_info.zip + ls + sudo unzip -o data/stats_current_test_info.zip rm data/stats_current_test_info.zip git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From 902c05e0d2ff8660b34752c2e2de9ce5149f0b29 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 14:46:45 +0100 Subject: [PATCH 102/185] Specify relative path for artifact --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index e7a4f99db7..cb980bcbd9 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,8 +67,8 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - ls - sudo unzip -o data/stats_current_test_info.zip + cd data/ + unzip -o stats_current_test_info.zip rm data/stats_current_test_info.zip git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From 973fdfb8fe69c1e79c1ae350cfb34c09a8f51848 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:05:07 +0100 Subject: [PATCH 103/185] Specify relative path --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index cb980bcbd9..b0e3f361b0 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -68,7 +68,7 @@ jobs: if: success() && env.MAINTENANCE == 'on' run: | cd data/ - unzip -o stats_current_test_info.zip + unzip -o ./stats_current_test_info.zip rm data/stats_current_test_info.zip git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From f3683f91e59a1d531e20e4395763c12e294e1c63 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:15:06 +0100 Subject: [PATCH 104/185] Debug paths --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index b0e3f361b0..5040e7fe1a 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -68,6 +68,7 @@ jobs: if: success() && env.MAINTENANCE == 'on' run: | cd data/ + ls -la unzip -o ./stats_current_test_info.zip rm data/stats_current_test_info.zip git config --global user.email "github-actions[bot]@users.noreply.github.com" From 1db9b84b463b6bc879a6d4f5e4e53a324cfd41bb Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:21:03 +0100 Subject: [PATCH 105/185] Debug permissions --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 5040e7fe1a..15cb349f40 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -68,6 +68,7 @@ jobs: if: success() && env.MAINTENANCE == 'on' run: | cd data/ + chmod -x stats_current_test_info.zip ls -la unzip -o ./stats_current_test_info.zip rm data/stats_current_test_info.zip From 5d2c1eee117e68c83820d2243c0668740fd574b8 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:26:40 +0100 Subject: [PATCH 106/185] Fix typo --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 15cb349f40..63d0684c6b 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -68,7 +68,7 @@ jobs: if: success() && env.MAINTENANCE == 'on' run: | cd data/ - chmod -x stats_current_test_info.zip + chmod +x stats_current_test_info.zip ls -la unzip -o ./stats_current_test_info.zip rm data/stats_current_test_info.zip From f328820ba7b7c6b95eb9c584465a855de1da808b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:33:43 +0100 Subject: [PATCH 107/185] git status --- .github/workflows/test-lp.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 63d0684c6b..65d83085fe 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,11 +67,8 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - cd data/ - chmod +x stats_current_test_info.zip - ls -la - unzip -o ./stats_current_test_info.zip rm data/stats_current_test_info.zip + git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git add data/stats_current_test_info.yml From bd50a90a461ac287637291e86798b8b4ecc7984b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:40:13 +0100 Subject: [PATCH 108/185] Add arg to rm --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 65d83085fe..1c29b2fc45 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,7 +67,7 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - rm data/stats_current_test_info.zip + rm -rf data/stats_current_test_info.zip git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From 970c0e40826e715cc9c73966cb1407871ba1cf4b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 15:56:48 +0100 Subject: [PATCH 109/185] Debug machine --- .github/workflows/test-lp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 1c29b2fc45..9e9bbcb820 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,12 +67,15 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | + ls .. rm -rf data/stats_current_test_info.zip git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git add data/stats_current_test_info.yml + git status git commit -m "Update stats_current_test_info.yml" + git status - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() && env.MAINTENANCE == 'on' From dd031c819a65ef07ee4ed122dce959fae1ef3fcd Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 14 Jan 2025 16:09:20 +0100 Subject: [PATCH 110/185] Change checkout strategy --- .github/workflows/test-lp.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 9e9bbcb820..c42f088b9f 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -52,12 +52,11 @@ jobs: with: name: stats_current_test_info path: data/stats_current_test_info.yml - - name: Checkout tools repo + - name: Checkout main branch uses: actions/checkout@v4 if: success() && env.MAINTENANCE == 'on' with: - repository: ArmDeveloperEcosystem/native-runner-arm-learning-paths - path: native-runner-arm-learning-paths + path: main - name: Download a single artifact uses: actions/download-artifact@v4 if: success() && env.MAINTENANCE == 'on' From 65af5c8e24193a3647a354370f0b49c25ab8deda Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 08:36:07 +0100 Subject: [PATCH 111/185] Use ref instead of path --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index c42f088b9f..a8e5ba3d52 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -7,7 +7,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 with: - path: ${{ steps.vars.outputs.branch-name }} + ref: ${{ steps.vars.outputs.branch-name }} - name: Get all changed markdown files id: changed-markdown-files uses: tj-actions/changed-files@v44 @@ -56,7 +56,7 @@ jobs: uses: actions/checkout@v4 if: success() && env.MAINTENANCE == 'on' with: - path: main + ref: main - name: Download a single artifact uses: actions/download-artifact@v4 if: success() && env.MAINTENANCE == 'on' From 90451d73eeec8393aeedbe747ecd7f5c9fca3bc3 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 08:47:30 +0100 Subject: [PATCH 112/185] Debug artifact --- .github/workflows/test-lp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index a8e5ba3d52..777e2b9b78 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -66,8 +66,7 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - ls .. - rm -rf data/stats_current_test_info.zip + ls -la data/ git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From 7686a70c01dc39da1cf5acf9147a8fe934a5434c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 08:53:22 +0100 Subject: [PATCH 113/185] Unzip artifact --- .github/workflows/test-lp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 777e2b9b78..47eada5722 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -66,7 +66,8 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - ls -la data/ + unzip -o data/stats_current_test_info.zip + rm -rf data/stats_current_test_info.zip git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From c2302fd6368e09c02cef7657d1cdd9a2b3e2d4e4 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 09:01:06 +0100 Subject: [PATCH 114/185] git diff --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 47eada5722..be7f4a7689 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -66,8 +66,8 @@ jobs: - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - unzip -o data/stats_current_test_info.zip rm -rf data/stats_current_test_info.zip + git diff git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" From 8ba0b4aacdda2ecc885c04b00d63f67734216c1e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 09:24:25 +0100 Subject: [PATCH 115/185] Separate steps --- .github/workflows/test-lp.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index be7f4a7689..f123ee4781 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -63,12 +63,18 @@ jobs: with: name: stats_current_test_info path: data/stats_current_test_info.zip - - name: Add changes to main + - name: Unzip artifact if: success() && env.MAINTENANCE == 'on' run: | - rm -rf data/stats_current_test_info.zip + ls -la data/ + unzip -o ./data/stats_current_test_info.zip + ls -la data/ git diff git status + - name: Add changes to main + if: success() && env.MAINTENANCE == 'on' + run: | + git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git add data/stats_current_test_info.yml From 609b21f86f3c8021840673346984459f2273429d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 09:34:21 +0100 Subject: [PATCH 116/185] Use tar instead of unzip --- .github/workflows/test-lp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index f123ee4781..c92090f403 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -67,7 +67,7 @@ jobs: if: success() && env.MAINTENANCE == 'on' run: | ls -la data/ - unzip -o ./data/stats_current_test_info.zip + tar -xvf ./data/stats_current_test_info.zip ls -la data/ git diff git status From 4d8d5496e0e6f7b102888c3d2e9de1926775c85b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 09:43:28 +0100 Subject: [PATCH 117/185] Debug artifact path --- .github/workflows/test-lp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index c92090f403..633f5eaa41 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -66,8 +66,7 @@ jobs: - name: Unzip artifact if: success() && env.MAINTENANCE == 'on' run: | - ls -la data/ - tar -xvf ./data/stats_current_test_info.zip + ls -la data/stats_current_test_info.zip ls -la data/ git diff git status From b8227e24d916020d505e88c4370f46d832438540 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 09:49:34 +0100 Subject: [PATCH 118/185] Change artifact path --- .github/workflows/test-lp.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 633f5eaa41..d9cd8fc0e2 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -62,18 +62,15 @@ jobs: if: success() && env.MAINTENANCE == 'on' with: name: stats_current_test_info - path: data/stats_current_test_info.zip + path: data/ - name: Unzip artifact if: success() && env.MAINTENANCE == 'on' run: | - ls -la data/stats_current_test_info.zip - ls -la data/ git diff git status - name: Add changes to main if: success() && env.MAINTENANCE == 'on' run: | - git status git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" git add data/stats_current_test_info.yml From 44d0bc8a0b0506a7d04fe28744af015f2d4a3f63 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 10:03:39 +0100 Subject: [PATCH 119/185] Change branch names --- .github/workflows/test-lp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index d9cd8fc0e2..1cb98615bb 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -86,5 +86,5 @@ jobs: body: | Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - base: ${{ github.repository }} - branch: main + branch: update-stats-current-test-info + base: main \ No newline at end of file From 06c5b34b0f367deb98f2b0c37ab6fbec272193b8 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 15 Jan 2025 11:11:13 +0100 Subject: [PATCH 120/185] Test permissions --- .github/workflows/test-lp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 1cb98615bb..54340fc918 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,5 +1,7 @@ name: Test Learning Path on: pull_request +permissions: + pull-requests: write jobs: Test-Pull-Request: runs-on: arm-linux-runner From 9a1cb3d256e0263003883265f66cc88456fca007 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 17 Jan 2025 10:01:57 +0100 Subject: [PATCH 121/185] Final permission test --- .github/workflows/test-lp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 54340fc918..37c734130c 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,7 +1,9 @@ name: Test Learning Path on: pull_request permissions: - pull-requests: write + contents: write + pull-requests: write + jobs: Test-Pull-Request: runs-on: arm-linux-runner From 78c07c68f21e747c209a375f280ca0c967b77aef Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 17 Jan 2025 11:19:52 +0100 Subject: [PATCH 122/185] Separate jobs --- .github/workflows/stats-pr.yml | 32 ++++++++++++++++++++++++++++ .github/workflows/test-lp.yml | 38 +--------------------------------- 2 files changed, 33 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/stats-pr.yml diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml new file mode 100644 index 0000000000..81e99460ff --- /dev/null +++ b/.github/workflows/stats-pr.yml @@ -0,0 +1,32 @@ +name: Open Pull Request with updated stats file +on: + workflow_run: + workflows: ["Test Learning Path"] + types: [completed] +jobs: + stats-pr: + runs-on: arm-linux-runner + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: main + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + run_id: ${{ github.event.workflow_run.id }} + name: stats_current_test_info + path: data/ + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + if: success() + with: + commit-message: update stats_current_test_info.yml + title: Update stats_current_test_info.yml + body: | + Update test result file with recent run + Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request + branch: update-stats-current-test-info + base: main + + # Add your build and test steps here diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 37c734130c..967deae324 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -50,45 +50,9 @@ jobs: if: env.MAINTENANCE == 'off' && success() # Skip opening a PR if tests have not been run run: echo "Maintenance is turned off for one or more files" - - name: Archive production artifacts + - name: Upload stats artifact uses: actions/upload-artifact@v4 if: success() && env.MAINTENANCE == 'on' with: name: stats_current_test_info path: data/stats_current_test_info.yml - - name: Checkout main branch - uses: actions/checkout@v4 - if: success() && env.MAINTENANCE == 'on' - with: - ref: main - - name: Download a single artifact - uses: actions/download-artifact@v4 - if: success() && env.MAINTENANCE == 'on' - with: - name: stats_current_test_info - path: data/ - - name: Unzip artifact - if: success() && env.MAINTENANCE == 'on' - run: | - git diff - git status - - name: Add changes to main - if: success() && env.MAINTENANCE == 'on' - run: | - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add data/stats_current_test_info.yml - git status - git commit -m "Update stats_current_test_info.yml" - git status - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - if: success() && env.MAINTENANCE == 'on' - with: - commit-message: update stats_current_test_info.yml - title: Update stats_current_test_info.yml - body: | - Update test result file with recent run - Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request - branch: update-stats-current-test-info - base: main \ No newline at end of file From d8e98a9ab684200d1f620a486e62b76be54d7115 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:26:52 +0100 Subject: [PATCH 123/185] Create stats-pr.yml --- .github/workflows/stats-pr.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/stats-pr.yml diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml new file mode 100644 index 0000000000..45b2abd099 --- /dev/null +++ b/.github/workflows/stats-pr.yml @@ -0,0 +1,30 @@ +name: Open Pull Request with updated stats file +on: + workflow_run: + workflows: ["Test Learning Path"] + types: [completed] +jobs: + stats-pr: + runs-on: arm-linux-runner + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: main + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + run_id: ${{ github.event.workflow_run.id }} + name: stats_current_test_info + path: data/ + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + if: success() + with: + commit-message: update stats_current_test_info.yml + title: Update stats_current_test_info.yml + body: | + Update test result file with recent run + Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request + branch: update-stats-current-test-info + base: main From 5841fb07d211540f27d74b0561402e8b96a59e14 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 17 Jan 2025 11:27:17 +0100 Subject: [PATCH 124/185] Stats PR file --- .github/workflows/stats-pr.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 81e99460ff..aebc5d9ef7 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -27,6 +27,4 @@ jobs: Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request branch: update-stats-current-test-info - base: main - - # Add your build and test steps here + base: main \ No newline at end of file From 279ffa96a7a692e935da563b24b46efe8352ad99 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 17 Jan 2025 11:33:01 +0100 Subject: [PATCH 125/185] Change run-id parameter --- .github/workflows/stats-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index aebc5d9ef7..5f0718288d 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -14,7 +14,7 @@ jobs: - name: Download a single artifact uses: actions/download-artifact@v4 with: - run_id: ${{ github.event.workflow_run.id }} + run-id: ${{ github.event.workflow_run.id }} name: stats_current_test_info path: data/ - name: Create Pull Request From b82610cfddbcbf6c9a6a8a31097a9cfeb200117c Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:39:56 +0100 Subject: [PATCH 126/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 45b2abd099..067855ee49 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -14,7 +14,7 @@ jobs: - name: Download a single artifact uses: actions/download-artifact@v4 with: - run_id: ${{ github.event.workflow_run.id }} + run-id: ${{ github.event.workflow_run.id }} name: stats_current_test_info path: data/ - name: Create Pull Request From 74b125b6d2dd5f9404816d0d76a010b0cc49b4ce Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 17 Jan 2025 11:40:42 +0100 Subject: [PATCH 127/185] Mock change --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 967deae324..d08705ae21 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -56,3 +56,4 @@ jobs: with: name: stats_current_test_info path: data/stats_current_test_info.yml + From 264f8d52b95ba61e46215b1fc83773f5d728138a Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:38:48 +0100 Subject: [PATCH 128/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 067855ee49..e288b925fd 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -15,7 +15,6 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} - name: stats_current_test_info path: data/ - name: Create Pull Request uses: peter-evans/create-pull-request@v6 From fc71f67d9c546bd67fd2779bdfa819c49219d2d3 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 17 Jan 2025 13:39:14 +0100 Subject: [PATCH 129/185] Mock commit --- .github/workflows/test-lp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index d08705ae21..a6b07302c8 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -55,5 +55,4 @@ jobs: if: success() && env.MAINTENANCE == 'on' with: name: stats_current_test_info - path: data/stats_current_test_info.yml - + path: data/stats_current_test_info.yml \ No newline at end of file From c81b7cf7156f9ef1be8b0f3d6f9bedba550c691c Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 09:30:25 +0100 Subject: [PATCH 130/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index e288b925fd..4a798020ab 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -15,7 +15,11 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} - path: data/ + path: data + - name: Display structure of downloaded files + run: | + ls -la data + git status - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() From 6f7f13d0041c3cc1360dced67eae2ac1581464eb Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 09:31:07 +0100 Subject: [PATCH 131/185] Mock commit --- .github/workflows/test-lp.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index a6b07302c8..347347e8be 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,8 +1,5 @@ name: Test Learning Path on: pull_request -permissions: - contents: write - pull-requests: write jobs: Test-Pull-Request: From 270989f6788e9a4b316c04a2084c9b5100b99c66 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 09:37:56 +0100 Subject: [PATCH 132/185] Test status change of anaconda.md --- data/stats_current_test_info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index d3897a8598..35880c63ad 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -31,7 +31,7 @@ sw_categories: anaconda: readable_title: Anaconda tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: failed ansible: readable_title: Ansible tests_and_status: From ca8bbf71c15a614d9e45081dd7311f040eecbbe2 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:06:21 +0100 Subject: [PATCH 133/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 4a798020ab..36af2b8fd9 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -15,7 +15,6 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} - path: data - name: Display structure of downloaded files run: | ls -la data From 461060de30975d9fb1d460f34a3057975f0dae29 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 10:19:57 +0100 Subject: [PATCH 134/185] Mock commit --- .github/workflows/test-lp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 347347e8be..ccfa7525fd 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,6 +1,5 @@ name: Test Learning Path on: pull_request - jobs: Test-Pull-Request: runs-on: arm-linux-runner From 8a895e4eb2c9b4dc45d213bba8e7183d086eb6b0 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:41:18 +0100 Subject: [PATCH 135/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 36af2b8fd9..b50d853775 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -3,6 +3,7 @@ on: workflow_run: workflows: ["Test Learning Path"] types: [completed] +permissions: read-all jobs: stats-pr: runs-on: arm-linux-runner @@ -15,6 +16,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} - name: Display structure of downloaded files run: | ls -la data From fc833ceadbd07fbfba25b4390bf6f649ecad840b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 10:41:36 +0100 Subject: [PATCH 136/185] Mock commit --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index ccfa7525fd..347347e8be 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,5 +1,6 @@ name: Test Learning Path on: pull_request + jobs: Test-Pull-Request: runs-on: arm-linux-runner From d98fc44b666f51c80bf901df056836bf8d8c621f Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:52:03 +0100 Subject: [PATCH 137/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index b50d853775..e0f4e65e26 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -3,7 +3,10 @@ on: workflow_run: workflows: ["Test Learning Path"] types: [completed] -permissions: read-all +permissions: + actions: read + contents: write + pull-requests: write jobs: stats-pr: runs-on: arm-linux-runner @@ -16,6 +19,7 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} + path: data/ github-token: ${{ github.token }} - name: Display structure of downloaded files run: | From 0d4f705784eb34e86f32ef90fb90f980ff8d8862 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 10:52:13 +0100 Subject: [PATCH 138/185] Mock commit --- .github/workflows/test-lp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 347347e8be..ccfa7525fd 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,6 +1,5 @@ name: Test Learning Path on: pull_request - jobs: Test-Pull-Request: runs-on: arm-linux-runner From 50387b14ef751c15bb1546f3cafee30f270d8d5d Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:01:03 +0100 Subject: [PATCH 139/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index e0f4e65e26..7a12d7c460 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -19,12 +19,11 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} - path: data/ github-token: ${{ github.token }} - - name: Display structure of downloaded files + - name: Move stats file run: | - ls -la data - git status + mv stats_current_test_info/stats_current_test_info.yml data/stats_current_test_info.yml + rm -rf stats_current_test_info - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() From 03c1e058260575faae6e2c3a07f5896e60c025a7 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 11:01:24 +0100 Subject: [PATCH 140/185] Mock commit --- .github/workflows/test-lp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index ccfa7525fd..347347e8be 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,5 +1,6 @@ name: Test Learning Path on: pull_request + jobs: Test-Pull-Request: runs-on: arm-linux-runner From 93b485c83299969cd6ac895325bfd64f7360bd2b Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:16:06 +0100 Subject: [PATCH 141/185] Update stats_current_test_info.yml --- data/stats_current_test_info.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index d3897a8598..80acda4247 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -31,7 +31,7 @@ sw_categories: anaconda: readable_title: Anaconda tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: failed ansible: readable_title: Ansible tests_and_status: @@ -153,15 +153,15 @@ sw_categories: ssh: readable_title: SSH tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed streamline-cli: readable_title: Streamline CLI Tools tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed sysbox: readable_title: Sysbox tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed terraform: readable_title: Terraform tests_and_status: @@ -169,11 +169,11 @@ sw_categories: topdown-tool: readable_title: Telemetry Solution (Topdown Methodology) tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed vnc: readable_title: VNC on Arm Linux tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed laptops-and-desktops: {} microcontrollers: tfm: From 5c23571437062602a5886c98e7ad7fcd4dbc2e0d Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:17:19 +0100 Subject: [PATCH 142/185] Update stats_current_test_info.yml --- data/stats_current_test_info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index 80acda4247..190873a43f 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -149,7 +149,7 @@ sw_categories: rust_embedded: readable_title: Rust for Embedded Applications tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed ssh: readable_title: SSH tests_and_status: From efc43904490dbf941fbb48302d5142c4acccb239 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 11:17:45 +0100 Subject: [PATCH 143/185] Test is anaconda.md status is changed --- .github/workflows/test-lp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 347347e8be..ccfa7525fd 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -1,6 +1,5 @@ name: Test Learning Path on: pull_request - jobs: Test-Pull-Request: runs-on: arm-linux-runner From 55cd053c0131734c6e3e5422c4ad405f01e9ddd1 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 15:20:22 +0100 Subject: [PATCH 144/185] Revert anaconda.md change --- content/install-guides/anaconda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/anaconda.md b/content/install-guides/anaconda.md index fbcd035dec..631b145345 100644 --- a/content/install-guides/anaconda.md +++ b/content/install-guides/anaconda.md @@ -50,7 +50,7 @@ The installer requires some desktop related libraries. The dependencies can be m For Ubuntu/Debian, run the command: -```bash +```console sudo apt update sudo apt install xfce4 -y ``` From 50909d5f84e60b77fdce58c003f5d20b1aa1321d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 20 Jan 2025 15:35:12 +0100 Subject: [PATCH 145/185] Update anaconda.md --- content/install-guides/anaconda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/anaconda.md b/content/install-guides/anaconda.md index 631b145345..fbcd035dec 100644 --- a/content/install-guides/anaconda.md +++ b/content/install-guides/anaconda.md @@ -50,7 +50,7 @@ The installer requires some desktop related libraries. The dependencies can be m For Ubuntu/Debian, run the command: -```console +```bash sudo apt update sudo apt install xfce4 -y ``` From c8825010b4615b932945b0b18f35a3359024fec9 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 21 Jan 2025 09:55:34 +0100 Subject: [PATCH 146/185] Clean up tests --- .github/workflows/stats-pr.yml | 20 +++++++++++++++----- .github/workflows/test-lp.yml | 10 +++++----- content/install-guides/anaconda.md | 2 +- {.github/workflows => tools}/test_lp.sh | 0 4 files changed, 21 insertions(+), 11 deletions(-) rename {.github/workflows => tools}/test_lp.sh (100%) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index b2b8fd1709..0d867b4822 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -1,26 +1,36 @@ -name: Open Pull Request with updated stats file +name: Open Pull Request with updated stats report on: workflow_run: workflows: ["Test Learning Path"] types: [completed] +permissions: + actions: read + contents: write + pull-requests: write jobs: stats-pr: runs-on: arm-linux-runner steps: - - name: Checkout code + - name: Checkout main branch uses: actions/checkout@v2 with: ref: main - - name: Download a single artifact + - name: Download stats report as artifact uses: actions/download-artifact@v4 with: + # Run ID of the workflow that uploaded the artifact run-id: ${{ github.event.workflow_run.id }} - path: data/ + github-token: ${{ github.token }} + - name: Move stats file + # Unpack the artifact and move the stats file to the correct location + run: | + mv stats_current_test_info/stats_current_test_info.yml data/stats_current_test_info.yml + rm -rf stats_current_test_info - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() with: - commit-message: update stats_current_test_info.yml + commit-message: Update stats_current_test_info.yml title: Update stats_current_test_info.yml body: | Update test result file with recent run diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index ccfa7525fd..3bb6f2b35c 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -17,12 +17,12 @@ jobs: - name: Install dependencies if: steps.changed-markdown-files.outputs.any_changed == 'true' run: pip install -r tools/requirements.txt - - name: Run test suite for all changed files + - name: Run test suite for all changed .md files id: run-suite if: steps.changed-markdown-files.outputs.any_changed == 'true' # Run the test suite run: | - set -o pipefail; ./.github/workflows/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt + set -o pipefail; ./tools/test_lp.sh ${{ steps.changed-markdown-files.outputs.all_changed_files }} 2>&1 | tee test-lp-output.txt - name: Parse test suite errors id: test-suite-state if: success() @@ -30,7 +30,7 @@ jobs: run: | cat test-lp-output.txt | grep -q 'Tests failed in test suite' && echo "TEST_SUITE_ERRORS=true" >> "$GITHUB_ENV" \ || echo "TEST_SUITE_ERRORS=false" >> "$GITHUB_ENV" - - name: Test condition + - name: Check for errors in test suite if: env.TEST_SUITE_ERRORS == 'true' && success() run: | echo "Test failures detected in test suite, check the output in earlier steps" @@ -42,10 +42,10 @@ jobs: run: | cat test-lp-output.txt | grep -q 'maintenance is turned off' && echo "MAINTENANCE=off" >> "$GITHUB_ENV" \ || echo "MAINTENANCE=on" >> "$GITHUB_ENV" - - name: Test condition + - name: Check if maintenance is turned off if: env.MAINTENANCE == 'off' && success() - # Skip opening a PR if tests have not been run run: echo "Maintenance is turned off for one or more files" + # Only upload artifact if maintenance is on - name: Upload stats artifact uses: actions/upload-artifact@v4 if: success() && env.MAINTENANCE == 'on' diff --git a/content/install-guides/anaconda.md b/content/install-guides/anaconda.md index fbcd035dec..631b145345 100644 --- a/content/install-guides/anaconda.md +++ b/content/install-guides/anaconda.md @@ -50,7 +50,7 @@ The installer requires some desktop related libraries. The dependencies can be m For Ubuntu/Debian, run the command: -```bash +```console sudo apt update sudo apt install xfce4 -y ``` diff --git a/.github/workflows/test_lp.sh b/tools/test_lp.sh similarity index 100% rename from .github/workflows/test_lp.sh rename to tools/test_lp.sh From 9980d428c6eba44bf019cca71b7923924f6c8e9d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 22 Jan 2025 08:54:12 +0100 Subject: [PATCH 147/185] Framework clean-up --- tools/check.py | 2 +- tools/test_lp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/check.py b/tools/check.py index a6ba671e1d..767c3f170c 100644 --- a/tools/check.py +++ b/tools/check.py @@ -215,7 +215,7 @@ def check(json_file, start, stop, md_article): {ethos_u65} NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp" ) else: - logging.debug(f"Type '{test_type}' not supported for testing. Contact the maintainers if you think this is a mistake.") + logging.info(f"Type '{test_type}' not supported for testing. Contact the maintainers if you think this is a mistake.") bar(skipped=True) continue diff --git a/tools/test_lp.sh b/tools/test_lp.sh index 3331f07c12..3becf4e28e 100755 --- a/tools/test_lp.sh +++ b/tools/test_lp.sh @@ -1,3 +1,4 @@ +# Run by test-lp.yml GitHub Action ALL_CHANGED_FILES=$@ # Install dependencies and run tests, @@ -18,7 +19,6 @@ done CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests - for file in ${CONTENT_PATHS_UNIQUE[*]}; do tools/maintenance.py -i ${file} --stats-report done From f14af0ab268e754eaebb488e156552073857066f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 5 Aug 2024 14:11:04 +0200 Subject: [PATCH 148/185] Update test framework - Refactor code - Rename variables - Improve exception handling - Add progress bar - Use f-strings where possible for readability - Improve documentation --- tools/maintenance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/maintenance.py b/tools/maintenance.py index c625d18163..82ffcbbfd8 100755 --- a/tools/maintenance.py +++ b/tools/maintenance.py @@ -109,6 +109,7 @@ def main(): results_dict = {} # check if article is a csv file corresponding to a file list if args.instructions.endswith(".csv"): + # TODO idea: separate parsing of CSV into list, run in same way as a single one passed logging.info("Parsing CSV " + args.instructions) with open(args.instructions) as f: next(f) # skip header From ec985e38904a9b0649a015d555b17484e77b9a4e Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Tue, 13 Aug 2024 13:32:37 +0200 Subject: [PATCH 149/185] Merge report.py --- tools/report.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/report.py b/tools/report.py index f3120d54e3..3a525653d0 100644 --- a/tools/report.py +++ b/tools/report.py @@ -19,8 +19,6 @@ "content/learning-paths/automotive"] - - """ Returns the date (yyyy-mm-dd) which a file in the given directory was last updated. If Learning Path, changes in any file in the directory will count. @@ -72,9 +70,9 @@ def content_parser(directory, period): # check if article is older than the period if date < datetime.now() - timedelta(days = period): if is_lp: - art_list[directory + "/"] = f"{(datetime.now() - date).days} days ago" + art_list[directory + "/"] = "{} days ago".format((datetime.now() - date).days) else: - art_list[directory + "/" + item] = f"{(datetime.now() - date).days} days ago" + art_list[directory + "/" + item] = "{} days ago".format((datetime.now() - date).days) if "learning-paths" in directory: # no need to iterate further @@ -303,4 +301,5 @@ def report(period): writer.writeheader() for key in result.keys(): csvfile.write("%s, %s\n" % (key, result[key])) - logging.info(f"Results written to {function_start_directory}/{outdated_files_csv}") \ No newline at end of file + logging.info(f"Results written to {function_start_directory}/{outdated_files_csv}") + From 29ec4eaea483b114c3db08aed7e73066974b4bb2 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 14 Aug 2024 08:49:29 +0200 Subject: [PATCH 150/185] Add test script for GitHub Actions --- .github/workflows/test-lp.yml | 2 +- .github/workflows/test_lp.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 .github/workflows/test_lp.sh diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 3bb6f2b35c..6c3ff86936 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -51,4 +51,4 @@ jobs: if: success() && env.MAINTENANCE == 'on' with: name: stats_current_test_info - path: data/stats_current_test_info.yml \ No newline at end of file + path: data/stats_current_test_info.yml diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh new file mode 100755 index 0000000000..2a72b225f1 --- /dev/null +++ b/.github/workflows/test_lp.sh @@ -0,0 +1,3 @@ +echo "HELLO WORLD" +pip install -r $1/tools/requirements.txt +./tools/maintenance.py -i $1/content/install-guides/cmake.md \ No newline at end of file From 5a2857c2fa0ed0ae4158115890426014e410afcb Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 21 Oct 2024 15:26:54 +0200 Subject: [PATCH 151/185] Add armclang.md to test framework --- content/install-guides/armclang.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/install-guides/armclang.md b/content/install-guides/armclang.md index b0eb127200..320176b72f 100644 --- a/content/install-guides/armclang.md +++ b/content/install-guides/armclang.md @@ -110,9 +110,13 @@ export AC6_TOOLCHAIN_6_22_0=/home/$USER/ArmCompilerforEmbedded6.22/bin ## Set up the product license +<<<<<<< HEAD `Arm Compiler for Embedded` and `Arm Compiler for Embedded FuSa` are license managed. License setup instructions are available in the [Arm Licensing install guide](/install-guides/license/). +======= +Arm Compiler for Embedded and Arm Compiler for Embedded FuSa are license managed. License setup instructions are available in the [Arm Licensing install guide](../license/). +>>>>>>> 0bc88ccc (Add armclang.md to test framework) ## Verify installation From 18a89a8839c46fc751893290bc9875dc1545bb83 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 12 Sep 2024 17:00:48 +0200 Subject: [PATCH 152/185] Add Linux-based Install Guides to automatic testing - More to come --- content/install-guides/armpl.md | 1 - data/stats_current_test_info.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/content/install-guides/armpl.md b/content/install-guides/armpl.md index 5da02437a1..309463770a 100644 --- a/content/install-guides/armpl.md +++ b/content/install-guides/armpl.md @@ -120,7 +120,6 @@ The instructions shown below are for deb based installers for GCC users. In a terminal, run the command shown below to download the debian package: ```bash - wget https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/24-10/linux/arm-performance-libraries_24.10_deb_gcc.tar ``` diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index 453526aeb8..34173c1c9c 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -53,6 +53,18 @@ sw_categories: readable_title: Arduino core for the Raspberry Pi Pico tests_and_status: - ubuntu:latest: passed + ansible: + readable_title: Ansible + tests_and_status: + - ubuntu:latest: passed + aperf: + readable_title: AWS Perf (APerf) + tests_and_status: + - ubuntu:latest: passed + arduino-pico: + readable_title: Arduino core for the Raspberry Pi Pico + tests_and_status: + - ubuntu:latest: passed arm-gnu: readable_title: Arm GNU Toolchain tests_and_status: From f6bbce3d5e1dfc5d1c69d299a1513fa6339c256b Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 13:10:35 +0100 Subject: [PATCH 153/185] Add Linux-based install guides - Remove files that are generated for easier local testing --- content/install-guides/multipass.md | 6 +++--- content/install-guides/perf.md | 2 +- content/install-guides/pytorch.md | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index abdcfbc29b..10890834ab 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -52,7 +52,7 @@ Multipass uses the terms virtual machine and instance synonymously. Download Multipass for macOS. -```console +```bash wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg ``` @@ -60,7 +60,7 @@ wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multip Install the download using the package command. -```console +```bash sudo installer -pkg multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg -target / ``` @@ -90,7 +90,7 @@ sudo apt install cpu-checker -y To check if KVM is available run: -```console +```bash kvm-ok ``` diff --git a/content/install-guides/perf.md b/content/install-guides/perf.md index d69ab029cd..16abaec745 100644 --- a/content/install-guides/perf.md +++ b/content/install-guides/perf.md @@ -140,7 +140,7 @@ You can copy it to a location in your search path or run it from the current loc To copy it use: -```console +```bash sudo cp tools/perf/perf /usr/local/bin ``` diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index 6a723c9eb9..af70be95c6 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -46,7 +46,7 @@ aarch64 If you see a different result, then you are not using an Arm computer running 64-bit Linux. -PyTorch requires Python 3, and this can be installed with `pip`. +PyTorch requires Python 3, and this can be installed with `pip`. For Ubuntu, run: @@ -65,7 +65,7 @@ alias python=python3 It is recommended that you install PyTorch in your own Python virtual environment. Set up your virtual environment: -```bash +```bash python -m venv venv source venv/bin/activate ``` @@ -127,7 +127,7 @@ PyTorch built with: - Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/opt/rh/devtoolset-10/root/usr/bin/c++, CXX_FLAGS=-ffunction-sections -fdata-sections -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DLIBKINETO_NOXPUPTI=ON -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=open, TORCH_VERSION=2.5.1, USE_CUDA=OFF, USE_CUDNN=OFF, USE_CUSPARSELT=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF, ``` -The configuration output is an advanced option to check the tools and structure used to build PyTorch. +The configuration output is an advanced option to check the tools and structure used to build PyTorch. ## BFloat16 floating-point number format @@ -135,7 +135,7 @@ Recent Arm processors support the BFloat16 (BF16) number format in PyTorch. For To check if your system includes BFloat16, use the `lscpu` command: -```console +```bash lscpu | grep bf16 ``` @@ -147,7 +147,7 @@ Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asi If the result is blank, you do not have a processor with BFloat16. -BFloat16 provides improved performance and smaller memory footprint with the same dynamic range. You might experience a drop in model inference accuracy with BFloat16, but the impact is acceptable for the majority of applications. +BFloat16 provides improved performance and smaller memory footprint with the same dynamic range. You might experience a drop in model inference accuracy with BFloat16, but the impact is acceptable for the majority of applications. You can use an environment variable to enable BFloat16: @@ -171,7 +171,7 @@ export LRU_CACHE_CAPACITY=1024 ## Transparent huge pages -Transparent huge pages (THP) provide an alternative method of utilizing huge pages for virtual memory. Enabling THP might result in improved performance because it reduces the overhead of Translation Lookaside Buffer (TLB) lookups by using a larger virtual memory page size. +Transparent huge pages (THP) provide an alternative method of utilizing huge pages for virtual memory. Enabling THP might result in improved performance because it reduces the overhead of Translation Lookaside Buffer (TLB) lookups by using a larger virtual memory page size. To check if THP is available on your system, run: @@ -207,7 +207,7 @@ To profile a [Vision Transformer (ViT) model](https://huggingface.co/google/vit- ``` pip install transformers datasets -``` +``` Use a text editor to save the code below as `profile-vit.py`: @@ -298,7 +298,7 @@ Self CPU time total: 786.880ms ``` -Experiment with the two environment variables for BFloat16 and THP and observe the performance differences. +Experiment with the two environment variables for BFloat16 and THP and observe the performance differences. You can set each variable and run the test again and observe the new profile data and run time. @@ -397,7 +397,7 @@ The output will be similar to: Self CPU time total: 633.541ms ``` -You should see the `quantized::linear_dynamic` layer being profiled. You can see the improvement in the model inference performance using dynamic quantization. +You should see the `quantized::linear_dynamic` layer being profiled. You can see the improvement in the model inference performance using dynamic quantization. You are now ready to use PyTorch on Arm Linux. From 992c24b960838ef039e14fc1ca3dc8bc51a783b1 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 28 Oct 2024 13:46:59 +0100 Subject: [PATCH 154/185] Address test failures in PR --- content/install-guides/multipass.md | 6 +++--- content/install-guides/perf.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index 10890834ab..a00cc6f146 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -52,7 +52,7 @@ Multipass uses the terms virtual machine and instance synonymously. Download Multipass for macOS. -```bash +```console wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg ``` @@ -60,7 +60,7 @@ wget https://github.com/canonical/multipass/releases/download/v1.14.1-rc1/multip Install the download using the package command. -```bash +```console sudo installer -pkg multipass-1.14.1-rc1+mac.14+gf2381bfe9.mac-Darwin.pkg -target / ``` @@ -91,7 +91,7 @@ sudo apt install cpu-checker -y To check if KVM is available run: ```bash -kvm-ok +sudo kvm-ok ``` If KVM is available the output will be similar to: diff --git a/content/install-guides/perf.md b/content/install-guides/perf.md index 16abaec745..d69ab029cd 100644 --- a/content/install-guides/perf.md +++ b/content/install-guides/perf.md @@ -140,7 +140,7 @@ You can copy it to a location in your search path or run it from the current loc To copy it use: -```bash +```console sudo cp tools/perf/perf /usr/local/bin ``` From a0a1ea94ecf1126d47713c1fcf83812a488c6f10 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 13:13:21 +0100 Subject: [PATCH 155/185] Add Linux-based install guides --- content/install-guides/streamline-cli.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 12ebc32fa2..ec8f03e1e4 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -74,12 +74,11 @@ If you are using the `workflow_topdown_basic option`, ensure that your applicati ## Using Python scripts -The Python scripts provided with Streamline CLI tools require Python 3.8 or later, and depend on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. +The Python scripts provided with Streamline CLI tools require Python 3.8 or later, and depend on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. Create a virtual environment: -```sh -# From Bash +```bash python3 -m venv sl-venv source ./sl-venv/bin/activate ``` @@ -96,7 +95,7 @@ The Streamline CLI tools are available as a standalone download to enable easy i To download the latest version of the tool and extract it to the current working directory you can use our download utility script: -```sh +```bash wget https://artifacts.tools.arm.com/arm-performance-studio/Streamline_CLI_Tools/get-streamline-cli.py python3 get-streamline-cli.py install python3 -m pip install -r ./streamline_cli_tools/bin/requirements.txt @@ -104,7 +103,7 @@ python3 -m pip install -r ./streamline_cli_tools/bin/requirements.txt If you want to add the Streamline tools to your search path: -```sh +```bash export PATH=$PATH:$PWD/streamline_cli_tools/bin ``` @@ -112,14 +111,12 @@ The script can also be used to download a specific version, or install to a user * To list all available versions: - ```sh python3 get-streamline-cli.py list ``` * To download, but not install, a specific version: - ```sh python3 get-streamline-cli.py download --tool-version ``` @@ -169,13 +166,13 @@ You might need to adapt them slightly to other Linux distributions. To apply the patch to the latest 6.7 kernel, you can use `git`: -```console +```bash { cwd="$HOME/streamline_cli_tools" } git apply patch/v6.7-combined.patch ``` or `patch`: -```console +```bash { cwd="$HOME/streamline_cli_tools" } patch -p 1 -i patch/v6.7-combined.patch ``` From f7c94043bc21990eb5ec91d4bd5847ea14ee564d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Fri, 1 Nov 2024 13:35:32 +0100 Subject: [PATCH 156/185] Address errors in test suite --- content/install-guides/topdown-tool.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 3265736ebb..0d542de436 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -94,6 +94,7 @@ sudo pip3 install -e . {{% notice Note %}} If you are getting errors on the environment being externally managed, try creating a virtual environment. ```bash +cd telemetry-solution/tools/topdown_tool sudo apt install python3-venv -y python3 -m venv topdown-venv source topdown-venv/bin/activate From 0142d4f4a618d74e9f77cab1beb1bd3ec4430b0c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 11:16:48 +0100 Subject: [PATCH 157/185] Debug streamline-cli.md --- tools/check.py | 2 +- tools/parse.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/check.py b/tools/check.py index 767c3f170c..38795264c6 100644 --- a/tools/check.py +++ b/tools/check.py @@ -86,7 +86,7 @@ def write_commands_to_file(test_cmd_filename, test): # - An environment variable is specified cmd_args = { "env_source":"source", - "cwd":"cd", + "cwd":"cd ", "env":"export" } for cmd_arg in cmd_args.keys(): diff --git a/tools/parse.py b/tools/parse.py index c9361d7bfd..0585cebe89 100644 --- a/tools/parse.py +++ b/tools/parse.py @@ -170,6 +170,7 @@ def save_commands_to_json(md_article, cmds_list, learningpath=False, img=None): continue cmd_lines_header = cmd_lines[0] + logging.debug(cmd_lines_header) # if fvp type, check for arguments if "fvp" in cmd_lines_header: content[cmd_idx] = {"type": "fvp"} From a48f5170e593eb09ecdade337d36eb3dc6b03013 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 11:20:16 +0100 Subject: [PATCH 158/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index ec8f03e1e4..38847ab95a 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -79,6 +79,16 @@ The Python scripts provided with Streamline CLI tools require Python 3.8 or late Create a virtual environment: ```bash +<<<<<<< HEAD +======= +wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P $HOME +tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME +``` + +1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: + +```bash { cwd="$HOME/streamline_cli_tools" } +>>>>>>> 630e2a65 (Debug streamline-cli.md) python3 -m venv sl-venv source ./sl-venv/bin/activate ``` From 9b7b87475a5a458c1b91c33d3d503549b899c2a2 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 11:22:43 +0100 Subject: [PATCH 159/185] Debug streamline-cli.md --- content/install-guides/streamline-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index 38847ab95a..fab29e6b6b 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -82,7 +82,7 @@ Create a virtual environment: <<<<<<< HEAD ======= wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P $HOME -tar -xzf Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME +tar -xzf $HOME/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME ``` 1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: From ab22c9fcaadcb4b2e5251dee171b8ec1795a3f80 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 4 Nov 2024 15:22:33 +0100 Subject: [PATCH 160/185] Update stats_current_test_info.yml --- data/stats_current_test_info.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index 34173c1c9c..a6b35dd798 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -186,6 +186,26 @@ sw_categories: swift: readable_title: Swift tests_and_status: [] + rust: + readable_title: Rust for Linux Applications + tests_and_status: + - ubuntu:latest: passed + rust_embedded: + readable_title: Rust for Embedded Applications + tests_and_status: + - ubuntu:latest: passed + ssh: + readable_title: SSH + tests_and_status: + - ubuntu:latest: passed + streamline-cli: + readable_title: Streamline CLI Tools + tests_and_status: + - ubuntu:latest: passed + sysbox: + readable_title: Sysbox + tests_and_status: + - ubuntu:latest: passed terraform: readable_title: Terraform tests_and_status: @@ -199,6 +219,14 @@ sw_categories: tests_and_status: - ubuntu:latest: passed iot: {} + topdown-tool: + readable_title: Telemetry Solution (Topdown Methodology) + tests_and_status: + - ubuntu:latest: passed + vnc: + readable_title: VNC on Arm Linux + tests_and_status: + - ubuntu:latest: passed laptops-and-desktops: {} mobile-graphics-and-gaming: {} servers-and-cloud-computing: From 5fda354c4bf90b64cdf745f6a142141fc298035d Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:26:52 +0100 Subject: [PATCH 161/185] Create stats-pr.yml --- .github/workflows/stats-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 0d867b4822..a03ac71893 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -36,4 +36,4 @@ jobs: Update test result file with recent run Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request branch: update-stats-current-test-info - base: main \ No newline at end of file + base: main From 025dbee0d9240282926525e3e17906de95605cb1 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:52:03 +0100 Subject: [PATCH 162/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index a03ac71893..57d2b10f87 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -20,6 +20,7 @@ jobs: with: # Run ID of the workflow that uploaded the artifact run-id: ${{ github.event.workflow_run.id }} + path: data/ github-token: ${{ github.token }} - name: Move stats file # Unpack the artifact and move the stats file to the correct location From abe57c7c9e729371385930152d12b9802a96b056 Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:01:03 +0100 Subject: [PATCH 163/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 57d2b10f87..a03ac71893 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -20,7 +20,6 @@ jobs: with: # Run ID of the workflow that uploaded the artifact run-id: ${{ github.event.workflow_run.id }} - path: data/ github-token: ${{ github.token }} - name: Move stats file # Unpack the artifact and move the stats file to the correct location From 5db005d5a143e5abea41cb911cd0afa2d5b81e3b Mon Sep 17 00:00:00 2001 From: Annie <36964858+annietllnd@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:16:06 +0100 Subject: [PATCH 164/185] Update stats_current_test_info.yml --- data/stats_current_test_info.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index a6b35dd798..ef47e67494 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -197,15 +197,15 @@ sw_categories: ssh: readable_title: SSH tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed streamline-cli: readable_title: Streamline CLI Tools tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed sysbox: readable_title: Sysbox tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed terraform: readable_title: Terraform tests_and_status: @@ -222,11 +222,11 @@ sw_categories: topdown-tool: readable_title: Telemetry Solution (Topdown Methodology) tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed vnc: readable_title: VNC on Arm Linux tests_and_status: - - ubuntu:latest: passed + - ubuntu:latest: passed laptops-and-desktops: {} mobile-graphics-and-gaming: {} servers-and-cloud-computing: From b8a5ea1855d231078df6488b98a77c7a59628b6c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 23 Jan 2025 14:29:53 +0100 Subject: [PATCH 165/185] Fix armclang.md --- content/install-guides/armclang.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/content/install-guides/armclang.md b/content/install-guides/armclang.md index 320176b72f..b0eb127200 100644 --- a/content/install-guides/armclang.md +++ b/content/install-guides/armclang.md @@ -110,13 +110,9 @@ export AC6_TOOLCHAIN_6_22_0=/home/$USER/ArmCompilerforEmbedded6.22/bin ## Set up the product license -<<<<<<< HEAD `Arm Compiler for Embedded` and `Arm Compiler for Embedded FuSa` are license managed. License setup instructions are available in the [Arm Licensing install guide](/install-guides/license/). -======= -Arm Compiler for Embedded and Arm Compiler for Embedded FuSa are license managed. License setup instructions are available in the [Arm Licensing install guide](../license/). ->>>>>>> 0bc88ccc (Add armclang.md to test framework) ## Verify installation From c81baab7e48550a46e3869bdaf5b0ea28ee47691 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 23 Jan 2025 15:57:56 +0100 Subject: [PATCH 166/185] Address test failures --- content/install-guides/armpl.md | 2 +- content/install-guides/multipass.md | 2 +- content/install-guides/pytorch.md | 4 +-- content/install-guides/streamline-cli.md | 10 ------- content/install-guides/topdown-tool.md | 2 +- data/stats_current_test_info.yml | 38 +----------------------- tools/check.py | 2 +- 7 files changed, 7 insertions(+), 53 deletions(-) diff --git a/content/install-guides/armpl.md b/content/install-guides/armpl.md index 309463770a..34ce14e7a1 100644 --- a/content/install-guides/armpl.md +++ b/content/install-guides/armpl.md @@ -120,7 +120,7 @@ The instructions shown below are for deb based installers for GCC users. In a terminal, run the command shown below to download the debian package: ```bash -wget https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/24-10/linux/arm-performance-libraries_24.10_deb_gcc.tar +wget https://developer.arm.com/-/cdn-downloads/permalink/Arm-Performance-Libraries/Version_24.10/arm-performance-libraries_24.10_deb_gcc.tar ``` Use `tar` to extract the file and then change directory: diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index a00cc6f146..2718b3e92c 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -85,7 +85,7 @@ Install and run the `kvm-ok` command to confirm KVM is available. Install `kvm-ok` on Debian based Linux distributions using: ```bash -sudo apt install cpu-checker -y +sudo apt install cpu-checker kvm -y ``` To check if KVM is available run: diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index af70be95c6..b0981f4373 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -135,7 +135,7 @@ Recent Arm processors support the BFloat16 (BF16) number format in PyTorch. For To check if your system includes BFloat16, use the `lscpu` command: -```bash +```console lscpu | grep bf16 ``` @@ -211,7 +211,7 @@ pip install transformers datasets Use a text editor to save the code below as `profile-vit.py`: -```python { file_name="profile.py" } +```python { file_name="profile-vit.py" } import torch from transformers import ViTFeatureExtractor, ViTForImageClassification from datasets import load_dataset diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index fab29e6b6b..ec8f03e1e4 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -79,16 +79,6 @@ The Python scripts provided with Streamline CLI tools require Python 3.8 or late Create a virtual environment: ```bash -<<<<<<< HEAD -======= -wget https://artifacts.tools.arm.com/arm-performance-studio/2024.5/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -P $HOME -tar -xzf $HOME/Arm_Streamline_CLI_Tools_9.3.1_linux_arm64.tgz -C $HOME -``` - -1. The `sl-format.py` Python script requires Python 3.8 or later, and depends on several third-party modules. We recommend creating a Python virtual environment containing these modules to run the tools. For example: - -```bash { cwd="$HOME/streamline_cli_tools" } ->>>>>>> 630e2a65 (Debug streamline-cli.md) python3 -m venv sl-venv source ./sl-venv/bin/activate ``` diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 0d542de436..19ff627b43 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -88,7 +88,7 @@ Install `topdown-tool` in `/usr/local/bin` using: ```bash cd telemetry-solution/tools/topdown_tool -sudo pip3 install -e . +sudo pip3 install . ``` {{% notice Note %}} diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index ef47e67494..22ec2b1323 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -53,18 +53,6 @@ sw_categories: readable_title: Arduino core for the Raspberry Pi Pico tests_and_status: - ubuntu:latest: passed - ansible: - readable_title: Ansible - tests_and_status: - - ubuntu:latest: passed - aperf: - readable_title: AWS Perf (APerf) - tests_and_status: - - ubuntu:latest: passed - arduino-pico: - readable_title: Arduino core for the Raspberry Pi Pico - tests_and_status: - - ubuntu:latest: passed arm-gnu: readable_title: Arm GNU Toolchain tests_and_status: @@ -186,39 +174,15 @@ sw_categories: swift: readable_title: Swift tests_and_status: [] - rust: - readable_title: Rust for Linux Applications - tests_and_status: - - ubuntu:latest: passed - rust_embedded: - readable_title: Rust for Embedded Applications - tests_and_status: - - ubuntu:latest: passed - ssh: - readable_title: SSH - tests_and_status: - - ubuntu:latest: passed - streamline-cli: - readable_title: Streamline CLI Tools - tests_and_status: - - ubuntu:latest: passed - sysbox: - readable_title: Sysbox - tests_and_status: - - ubuntu:latest: passed terraform: readable_title: Terraform tests_and_status: - ubuntu:latest: passed - topdown-tool: - readable_title: Telemetry Solution (Topdown Methodology) - tests_and_status: - - ubuntu:latest: passed vnc: readable_title: VNC on Arm Linux tests_and_status: - ubuntu:latest: passed - iot: {} + iot: topdown-tool: readable_title: Telemetry Solution (Topdown Methodology) tests_and_status: diff --git a/tools/check.py b/tools/check.py index 38795264c6..ff1e940da8 100644 --- a/tools/check.py +++ b/tools/check.py @@ -215,7 +215,7 @@ def check(json_file, start, stop, md_article): {ethos_u65} NON_INTERACTIVE=1 --name test_fvp flebeau/arm-corstone-300-fvp" ) else: - logging.info(f"Type '{test_type}' not supported for testing. Contact the maintainers if you think this is a mistake.") + logging.debug(f"Type '{test_type}' not supported for testing. Contact the maintainers if you think this is a mistake.") bar(skipped=True) continue From 4812690bd81994d0d6030254d6ea4a5ad9874cc6 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 23 Jan 2025 18:16:33 +0100 Subject: [PATCH 167/185] Address test failures --- content/install-guides/armpl.md | 3 +-- content/install-guides/multipass.md | 2 +- content/install-guides/pytorch.md | 4 ++-- content/install-guides/topdown-tool.md | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/install-guides/armpl.md b/content/install-guides/armpl.md index 34ce14e7a1..ed87fbf56c 100644 --- a/content/install-guides/armpl.md +++ b/content/install-guides/armpl.md @@ -127,13 +127,12 @@ Use `tar` to extract the file and then change directory: ```bash tar -xf arm-performance-libraries_24.10_deb_gcc.tar -cd arm-performance-libraries_24.10_deb/ ``` Run the installation script as a super user: ```bash -sudo ./arm-performance-libraries_24.10_deb.sh --accept +sudo ./arm-performance-libraries_24.10_deb/arm-performance-libraries_24.10_deb.sh --accept ``` Using the `--accept` switch you automatically accept the End User License Agreement and the packages are installed to the `/opt/arm` directory. diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index 2718b3e92c..544fa6b11b 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -85,7 +85,7 @@ Install and run the `kvm-ok` command to confirm KVM is available. Install `kvm-ok` on Debian based Linux distributions using: ```bash -sudo apt install cpu-checker kvm -y +sudo apt install cpu-checker qemu-kvm -y ``` To check if KVM is available run: diff --git a/content/install-guides/pytorch.md b/content/install-guides/pytorch.md index b0981f4373..5d4e1ed115 100644 --- a/content/install-guides/pytorch.md +++ b/content/install-guides/pytorch.md @@ -197,7 +197,7 @@ With `madvise` you can use an environment variable to check performance with and To enable THP for PyTorch: -```console +```bash export THP_MEM_ALLOC_ENABLE=1 ``` @@ -205,7 +205,7 @@ export THP_MEM_ALLOC_ENABLE=1 To profile a [Vision Transformer (ViT) model](https://huggingface.co/google/vit-base-patch16-224), first download the transformers and datasets libraries: -``` +```bash pip install transformers datasets ``` diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 19ff627b43..bf07396bc7 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -88,6 +88,7 @@ Install `topdown-tool` in `/usr/local/bin` using: ```bash cd telemetry-solution/tools/topdown_tool +pip3 install packaging sudo pip3 install . ``` From 0fc7e8eb627078d8eda41fd14fe76cba64f0c940 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Thu, 23 Jan 2025 18:29:21 +0100 Subject: [PATCH 168/185] Address test failures --- content/install-guides/multipass.md | 4 ++-- content/install-guides/streamline-cli.md | 4 ++-- content/install-guides/topdown-tool.md | 17 +++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/content/install-guides/multipass.md b/content/install-guides/multipass.md index 544fa6b11b..25def1196a 100644 --- a/content/install-guides/multipass.md +++ b/content/install-guides/multipass.md @@ -85,12 +85,12 @@ Install and run the `kvm-ok` command to confirm KVM is available. Install `kvm-ok` on Debian based Linux distributions using: ```bash -sudo apt install cpu-checker qemu-kvm -y +sudo apt install cpu-checker -y ``` To check if KVM is available run: -```bash +```console sudo kvm-ok ``` diff --git a/content/install-guides/streamline-cli.md b/content/install-guides/streamline-cli.md index ec8f03e1e4..662cb9f443 100644 --- a/content/install-guides/streamline-cli.md +++ b/content/install-guides/streamline-cli.md @@ -166,13 +166,13 @@ You might need to adapt them slightly to other Linux distributions. To apply the patch to the latest 6.7 kernel, you can use `git`: -```bash { cwd="$HOME/streamline_cli_tools" } +```console git apply patch/v6.7-combined.patch ``` or `patch`: -```bash { cwd="$HOME/streamline_cli_tools" } +```console patch -p 1 -i patch/v6.7-combined.patch ``` diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index bf07396bc7..91054c631e 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -84,23 +84,24 @@ git clone https://git.gitlab.arm.com/telemetry-solution/telemetry-solution.git 2. Install the `topdown-tool` executable: -Install `topdown-tool` in `/usr/local/bin` using: +It's recommended to use use a virtual environment to install the packages: ```bash cd telemetry-solution/tools/topdown_tool +sudo apt install python3-venv -y +python3 -m venv topdown-venv +source topdown-venv/bin/activate pip3 install packaging -sudo pip3 install . ``` -{{% notice Note %}} -If you are getting errors on the environment being externally managed, try creating a virtual environment. +Now, install `topdown-tool` in `/usr/local/bin` + ```bash cd telemetry-solution/tools/topdown_tool -sudo apt install python3-venv -y -python3 -m venv topdown-venv -source topdown-venv/bin/activate +sudo pip3 install . ``` -{{% /notice %}} + + 3. Confirm you can run `top-down` using the `version` command: From 675f9856d9d8e0f5c2adc4f5d7a2dd1362005513 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 12:19:06 +0100 Subject: [PATCH 169/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 91054c631e..71d61846e3 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -71,7 +71,7 @@ For Debian based distributions (including Ubuntu) run: ```bash { target="ubuntu:latest" } sudo apt update -sudo apt install python3-pip python-is-python3 -y +sudo apt install python3-pip python-is-python3 python3-venv -y ``` ## Install the Telemetry Solution @@ -84,25 +84,19 @@ git clone https://git.gitlab.arm.com/telemetry-solution/telemetry-solution.git 2. Install the `topdown-tool` executable: -It's recommended to use use a virtual environment to install the packages: +Create a virtual environment for the installation. ```bash -cd telemetry-solution/tools/topdown_tool -sudo apt install python3-venv -y python3 -m venv topdown-venv source topdown-venv/bin/activate -pip3 install packaging ``` - -Now, install `topdown-tool` in `/usr/local/bin` +Install `topdown-tool` in `/usr/local/bin`: ```bash cd telemetry-solution/tools/topdown_tool -sudo pip3 install . +sudo pip3 install -e . ``` - - 3. Confirm you can run `top-down` using the `version` command: ```bash { target="ubuntu:latest" } From 7caa7cb57be01c54ee968bef76f0fb3c3bd07d58 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 12:32:07 +0100 Subject: [PATCH 170/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 71d61846e3..47ce42a8ff 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -71,7 +71,7 @@ For Debian based distributions (including Ubuntu) run: ```bash { target="ubuntu:latest" } sudo apt update -sudo apt install python3-pip python-is-python3 python3-venv -y +sudo apt install python3-pip python-is-python3 python3-venv linux-tools-generic linux-tools-$(uname -r) -y ``` ## Install the Telemetry Solution From c6c79f93cd50dd8525eec433a52cd24951a1c225 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 13:01:18 +0100 Subject: [PATCH 171/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 47ce42a8ff..d0b114fd18 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -71,7 +71,7 @@ For Debian based distributions (including Ubuntu) run: ```bash { target="ubuntu:latest" } sudo apt update -sudo apt install python3-pip python-is-python3 python3-venv linux-tools-generic linux-tools-$(uname -r) -y +sudo apt install python3-pip python-is-python3 python3-venv python3-packaging linux-tools-generic linux-tools-$(uname -r) -y ``` ## Install the Telemetry Solution From 7dc86773863dec1a087f9d435af13c52f483fc53 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 13:15:49 +0100 Subject: [PATCH 172/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index d0b114fd18..bd3ffae41d 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -89,6 +89,8 @@ Create a virtual environment for the installation. ```bash python3 -m venv topdown-venv source topdown-venv/bin/activate +pip3 install wheel +echo $(pip --version) ``` Install `topdown-tool` in `/usr/local/bin`: From e24bffa40f72155829f61238f141ad1d895008c6 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 13:24:22 +0100 Subject: [PATCH 173/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index bd3ffae41d..a701e6842a 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -89,8 +89,9 @@ Create a virtual environment for the installation. ```bash python3 -m venv topdown-venv source topdown-venv/bin/activate +pip3 install --upgrade pip==23.0 pip3 install wheel -echo $(pip --version) +pip3 install --upgrade packaging ``` Install `topdown-tool` in `/usr/local/bin`: From 02e4ea058edeaaeaab491548f54d4ea3e626457c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 13:37:32 +0100 Subject: [PATCH 174/185] Enable debug mode --- content/install-guides/topdown-tool.md | 2 +- tools/test_lp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index a701e6842a..4800155a0a 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -71,7 +71,7 @@ For Debian based distributions (including Ubuntu) run: ```bash { target="ubuntu:latest" } sudo apt update -sudo apt install python3-pip python-is-python3 python3-venv python3-packaging linux-tools-generic linux-tools-$(uname -r) -y +sudo apt install python-is-python3 python3-pip python3-venv python3-packaging linux-tools-generic linux-tools-$(uname -r) -y ``` ## Install the Telemetry Solution diff --git a/tools/test_lp.sh b/tools/test_lp.sh index 3becf4e28e..b8e14752c2 100755 --- a/tools/test_lp.sh +++ b/tools/test_lp.sh @@ -20,5 +20,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} --stats-report + tools/maintenance.py -i ${file} --debug --stats-report done From 2e08ea5b0973f68557ed802bec8019ebae65de5d Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 13:54:32 +0100 Subject: [PATCH 175/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 4800155a0a..579624f0b2 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -89,10 +89,10 @@ Create a virtual environment for the installation. ```bash python3 -m venv topdown-venv source topdown-venv/bin/activate -pip3 install --upgrade pip==23.0 +pip3 install --upgrade pip==24.0 pip3 install wheel -pip3 install --upgrade packaging ``` + Install `topdown-tool` in `/usr/local/bin`: ```bash From 38a37124f586319ed389895a88c4e99c5e3bd233 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 14:01:42 +0100 Subject: [PATCH 176/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 579624f0b2..513fa5d055 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -71,6 +71,7 @@ For Debian based distributions (including Ubuntu) run: ```bash { target="ubuntu:latest" } sudo apt update +sudo apt remove python3-pip sudo apt install python-is-python3 python3-pip python3-venv python3-packaging linux-tools-generic linux-tools-$(uname -r) -y ``` From b809503a65b3e137c9cb3964be3204daecd9fb1a Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 14:10:25 +0100 Subject: [PATCH 177/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 513fa5d055..69fa3cfcc4 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -71,7 +71,6 @@ For Debian based distributions (including Ubuntu) run: ```bash { target="ubuntu:latest" } sudo apt update -sudo apt remove python3-pip sudo apt install python-is-python3 python3-pip python3-venv python3-packaging linux-tools-generic linux-tools-$(uname -r) -y ``` @@ -88,17 +87,15 @@ git clone https://git.gitlab.arm.com/telemetry-solution/telemetry-solution.git Create a virtual environment for the installation. ```bash -python3 -m venv topdown-venv +python -m venv topdown-venv source topdown-venv/bin/activate -pip3 install --upgrade pip==24.0 -pip3 install wheel ``` Install `topdown-tool` in `/usr/local/bin`: ```bash cd telemetry-solution/tools/topdown_tool -sudo pip3 install -e . +sudo pip install -e . ``` 3. Confirm you can run `top-down` using the `version` command: From 4f1913868e79f2af1d98384d8b9e2adf97f4ad54 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 14:20:05 +0100 Subject: [PATCH 178/185] Update topdown-tool.md, disable debug mode --- content/install-guides/topdown-tool.md | 4 ++-- tools/test_lp.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 69fa3cfcc4..3d338ce7d6 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -93,14 +93,14 @@ source topdown-venv/bin/activate Install `topdown-tool` in `/usr/local/bin`: -```bash +```console cd telemetry-solution/tools/topdown_tool sudo pip install -e . ``` 3. Confirm you can run `top-down` using the `version` command: -```bash { target="ubuntu:latest" } +```console topdown-tool --help ``` diff --git a/tools/test_lp.sh b/tools/test_lp.sh index b8e14752c2..3becf4e28e 100755 --- a/tools/test_lp.sh +++ b/tools/test_lp.sh @@ -20,5 +20,5 @@ CONTENT_PATHS_UNIQUE=($(printf "%s\n" "${CONTENT_PATHS[@]}" | sort -u)) echo "Unique content paths: ${CONTENT_PATHS_UNIQUE[*]}" # Run the tests for file in ${CONTENT_PATHS_UNIQUE[*]}; do - tools/maintenance.py -i ${file} --debug --stats-report + tools/maintenance.py -i ${file} --stats-report done From bddfe5b7625c9061907e5ea0270a8f6f3e0339b6 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 14:48:40 +0100 Subject: [PATCH 179/185] Update stats_current_test_info.yml --- .github/workflows/stats-pr.yml | 1 + data/stats_current_test_info.yml | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index a03ac71893..e46b57454f 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -34,6 +34,7 @@ jobs: title: Update stats_current_test_info.yml body: | Update test result file with recent run + Triggered by workflow run ${{ github.event.workflow_run.id }} Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request branch: update-stats-current-test-info base: main diff --git a/data/stats_current_test_info.yml b/data/stats_current_test_info.yml index 22ec2b1323..5d34b23667 100644 --- a/data/stats_current_test_info.yml +++ b/data/stats_current_test_info.yml @@ -182,15 +182,11 @@ sw_categories: readable_title: VNC on Arm Linux tests_and_status: - ubuntu:latest: passed - iot: topdown-tool: readable_title: Telemetry Solution (Topdown Methodology) tests_and_status: - ubuntu:latest: passed - vnc: - readable_title: VNC on Arm Linux - tests_and_status: - - ubuntu:latest: passed + iot: {} laptops-and-desktops: {} mobile-graphics-and-gaming: {} servers-and-cloud-computing: From d38e912724980207ead95a26df57a5bf4a9de807 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 15:10:58 +0100 Subject: [PATCH 180/185] Update stats-pr.yml --- .github/workflows/stats-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index e46b57454f..575ae304f3 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -34,7 +34,7 @@ jobs: title: Update stats_current_test_info.yml body: | Update test result file with recent run - Triggered by workflow run ${{ github.event.workflow_run.id }} + Triggered by workflow run ${{ github.event.workflow_run.workflow_url }} Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request branch: update-stats-current-test-info base: main From c25aceb4ee2fe1d85612711fa4020c0caa5ebdbb Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 16:05:11 +0100 Subject: [PATCH 181/185] Add workflow URL to PR --- .github/workflows/stats-pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index 575ae304f3..e770d3ae5b 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -26,6 +26,10 @@ jobs: run: | mv stats_current_test_info/stats_current_test_info.yml data/stats_current_test_info.yml rm -rf stats_current_test_info + - name: Set workflow link as environment variable + run: echo "WORKFLOW_URL=${{ github.event.workflow_run.workflow_url }}" >> $GITHUB_ENV + - name: Echo Workflow URL + run: echo $WORKFLOW_URL - name: Create Pull Request uses: peter-evans/create-pull-request@v6 if: success() @@ -34,7 +38,7 @@ jobs: title: Update stats_current_test_info.yml body: | Update test result file with recent run - Triggered by workflow run ${{ github.event.workflow_run.workflow_url }} + Triggered by workflow run ${ WORKFLOW_URL } Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request branch: update-stats-current-test-info base: main From 6514487a0dde8b64fd88f5608ab26ea79529533c Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 16:16:31 +0100 Subject: [PATCH 182/185] Update test image name --- .github/workflows/stats-pr.yml | 2 +- .github/workflows/test-lp.yml | 2 +- .github/workflows/test_lp.sh | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100755 .github/workflows/test_lp.sh diff --git a/.github/workflows/stats-pr.yml b/.github/workflows/stats-pr.yml index e770d3ae5b..01f354646f 100644 --- a/.github/workflows/stats-pr.yml +++ b/.github/workflows/stats-pr.yml @@ -9,7 +9,7 @@ permissions: pull-requests: write jobs: stats-pr: - runs-on: arm-linux-runner + runs-on: ubuntu-24.04-arm steps: - name: Checkout main branch uses: actions/checkout@v2 diff --git a/.github/workflows/test-lp.yml b/.github/workflows/test-lp.yml index 6c3ff86936..4371ef45ac 100644 --- a/.github/workflows/test-lp.yml +++ b/.github/workflows/test-lp.yml @@ -2,7 +2,7 @@ name: Test Learning Path on: pull_request jobs: Test-Pull-Request: - runs-on: arm-linux-runner + runs-on: ubuntu-24.04-arm steps: - name: Check out repository code uses: actions/checkout@v4 diff --git a/.github/workflows/test_lp.sh b/.github/workflows/test_lp.sh deleted file mode 100755 index 2a72b225f1..0000000000 --- a/.github/workflows/test_lp.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo "HELLO WORLD" -pip install -r $1/tools/requirements.txt -./tools/maintenance.py -i $1/content/install-guides/cmake.md \ No newline at end of file From 9c1f380d8ff4d32d0097d01a213800230c0bb1d9 Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 17:12:03 +0100 Subject: [PATCH 183/185] Update perf.md, ssh.md --- content/install-guides/perf.md | 10 +++++++--- content/install-guides/ssh.md | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/content/install-guides/perf.md b/content/install-guides/perf.md index d69ab029cd..8a550587a6 100644 --- a/content/install-guides/perf.md +++ b/content/install-guides/perf.md @@ -116,15 +116,19 @@ Building Perf from source requires `gcc`, `flex`, `bison`, `git`, and `make`. In For Debian and Ubuntu run: ```bash -sudo apt install gcc flex bison make git -y +sudo apt update +sudo apt install make gcc flex bison pkg-config linux-tools-generic linux-tools-$(uname -r) \ +libzstd1 libdwarf-dev libdw-dev binutils-dev libcap-dev libelf-dev libnuma-dev python3 python3-dev python3-setuptools \ +libssl-dev libunwind-dev libdwarf-dev zlib1g-dev liblzma-dev libaio-dev libtraceevent-dev debuginfod \ +libpfm4-dev libslang2-dev systemtap-sdt-dev libperl-dev binutils-dev libbabeltrace-dev libiberty-dev libzstd-dev -y ``` Use `git` to get the source code. Use `--branch` to specify the Linux kernel source tree closest to your kernel version. -For example, if your kernel version is 5.15, use: +For example, if your kernel version is 6.8, use: ```bash -git clone --depth=1 --branch v5.15 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git +git clone --depth=1 --branch v6.8 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git ``` Change to the `linux` directory and build: diff --git a/content/install-guides/ssh.md b/content/install-guides/ssh.md index 7f33ca74bc..8d203d53fa 100644 --- a/content/install-guides/ssh.md +++ b/content/install-guides/ssh.md @@ -56,7 +56,7 @@ If the result includes a line with `sshd` the daemon is running. root 1113 1 0 18:48 ? 00:00:00 /usr/sbin/sshd -D ``` Another way to check if the SSH daemon is running is to query the SSH service. -```bash +```console sudo systemctl status sshd ``` If the output displays "running", then the SSH daemon is already running. From 7e9cf8c70800023ea1819995793ecf555ed429ce Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Mon, 27 Jan 2025 18:03:52 +0100 Subject: [PATCH 184/185] Update rust.md --- content/install-guides/rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/rust.md b/content/install-guides/rust.md index e92f5e617d..efb88e2f27 100644 --- a/content/install-guides/rust.md +++ b/content/install-guides/rust.md @@ -53,7 +53,7 @@ If you see a different result, you are not using an Arm computer running 64-bit Use the `apt` command to install the required software packages on any Debian-based Linux distribution, including Ubuntu. ```bash { target="ubuntu:latest" } -sudo apt update +sudo apt update sudo apt install -y curl gcc ``` @@ -140,7 +140,7 @@ You are ready to use the Rust programming language on your Arm Linux machine. To compile an example program, run the following commands: -```bash { env_source="~/.bashrc" } +```console cargo new hello cd hello cargo run From 5a27a0a3e856d8447f1099ac1952ea1251b66d8f Mon Sep 17 00:00:00 2001 From: Annie Tallund Date: Wed, 29 Jan 2025 13:51:03 +0100 Subject: [PATCH 185/185] Update topdown-tool.md --- content/install-guides/topdown-tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/install-guides/topdown-tool.md b/content/install-guides/topdown-tool.md index 3d338ce7d6..dfe40f0a2c 100644 --- a/content/install-guides/topdown-tool.md +++ b/content/install-guides/topdown-tool.md @@ -93,14 +93,14 @@ source topdown-venv/bin/activate Install `topdown-tool` in `/usr/local/bin`: -```console +```bash cd telemetry-solution/tools/topdown_tool sudo pip install -e . ``` 3. Confirm you can run `top-down` using the `version` command: -```console +```bash topdown-tool --help ```