diff --git a/images/base/info.json b/images/base/info.json index d49c6f0f..6e128ce5 100755 --- a/images/base/info.json +++ b/images/base/info.json @@ -1,8 +1,9 @@ { - "args" : { - "BASE_IMAGE" : "centos:centos7", - "NAME": "base", - "REPO_COMMIT": "alpha", - "REPO_URL": "n/a" - } -} + "args": { + "GIT": "false", + "BASE_IMAGE": "centos:centos7", + "NAME": "base", + "REPO_COMMIT": "alpha", + "REPO_URL": "n/a" + } +} \ No newline at end of file diff --git a/images/covered/info.json b/images/covered/info.json index ded59dbe..72dcb5bb 100755 --- a/images/covered/info.json +++ b/images/covered/info.json @@ -1,5 +1,6 @@ { "args" : { + "GIT": "true", "BASE_IMAGE" : "base", "NAME": "covered", "REPO_URL": "https://github.com/Manarabdelaty/verilog-covered", diff --git a/images/foss-asic-tools/info.json b/images/foss-asic-tools/info.json index ce7c5e92..d3397ad0 100755 --- a/images/foss-asic-tools/info.json +++ b/images/foss-asic-tools/info.json @@ -1,5 +1,6 @@ { "args": { + "GIT": "false", "BASE_IMAGE": "base", "NAME": "foss-asic-tools", "REPO_URL": "https://github.com/efabless/foss-asic-tools", diff --git a/images/foss-asic-tools/scripts/env.sh b/images/foss-asic-tools/scripts/env.sh index ced81158..f6fba1ea 100755 --- a/images/foss-asic-tools/scripts/env.sh +++ b/images/foss-asic-tools/scripts/env.sh @@ -13,7 +13,7 @@ klayout_path=$(realpath $base_path/klayout/* ) netgen_path=$(get_path "netgen") openlane_tools_path=$(get_path "openlane_tools" ) riscv32i_path=$(get_path "riscv-gnu-toolchain-rv32i" ) -gaw3_path=$(get_path "gaw3") +gaw3_path=$(get_path "gaw3-xschem") ngscope_path=$(realpath $base_path/ngscope/*/usr/local/bin ) ngspice_path=$(get_path "ngspice") xschem_path=$(get_path "xschem") diff --git a/images/gaw3-xschem/info.json b/images/gaw3-xschem/info.json index 7e7082b7..27060c21 100755 --- a/images/gaw3-xschem/info.json +++ b/images/gaw3-xschem/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", - "NAME": "gaw3", + "NAME": "gaw3-xschem", "REPO_URL": "https://github.com/StefanSchippers/xschem-gaw.git", - "REPO_COMMIT": "2a1fc97bcc3081af72fc37a8bc52bc4632e176b2" + "REPO_COMMIT": "52ff1cf547c241d36d314bb3af8ab6b908ac7754" } -} +} \ No newline at end of file diff --git a/images/gtkwave/info.json b/images/gtkwave/info.json index b76c35a1..463d9209 100755 --- a/images/gtkwave/info.json +++ b/images/gtkwave/info.json @@ -1,8 +1,9 @@ { - "args" : { - "BASE_IMAGE" : "base", - "NAME": "gtkwave", - "REPO_URL": "https://github.com/gtkwave/gtkwave", - "REPO_COMMIT": "bc06f0fabd174d44f50647b09d6f7c702b3b6c40" - } -} + "args": { + "GIT": "true", + "BASE_IMAGE": "base", + "NAME": "gtkwave", + "REPO_URL": "https://github.com/gtkwave/gtkwave", + "REPO_COMMIT": "13fc69b24caa203d3b1946eb228d462c1e9d98c5" + } +} \ No newline at end of file diff --git a/images/irsim/info.json b/images/irsim/info.json index 7c680312..a87dd49a 100755 --- a/images/irsim/info.json +++ b/images/irsim/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "irsim", "REPO_URL": "https://github.com/rtimothyedwards/irsim", - "REPO_COMMIT": " 5f33a7328787f726c1a22e787c8cc810f46971d3" + "REPO_COMMIT": "3813495e55a21a024e62e21bd6993fac068a61b9" } } \ No newline at end of file diff --git a/images/iverilog/info.json b/images/iverilog/info.json index 27a8a971..e0d76d3b 100755 --- a/images/iverilog/info.json +++ b/images/iverilog/info.json @@ -1,8 +1,9 @@ { - "args" : { - "BASE_IMAGE" : "base", - "NAME": "iverilog", - "REPO_URL": "https://github.com/steveicarus/iverilog.git", - "REPO_COMMIT": "v11_0" - } -} + "args": { + "GIT": "true", + "BASE_IMAGE": "base", + "NAME": "iverilog", + "REPO_URL": "https://github.com/steveicarus/iverilog.git", + "REPO_COMMIT": "71c36d1289873e9e9fb2699c1de1f22dee2021e6" + } +} \ No newline at end of file diff --git a/images/klayout/info.json b/images/klayout/info.json index f6fb2120..41479c17 100755 --- a/images/klayout/info.json +++ b/images/klayout/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "klayout", "REPO_URL": "https://github.com/KLayout/klayout", - "REPO_COMMIT": "8b1278808485cc06aeb29cb9425b089df4c58546" + "REPO_COMMIT": "4598f87466f33fdab9dd52c2afc490df6df5f8c2" } } \ No newline at end of file diff --git a/images/magic/info.json b/images/magic/info.json index 1bdb87b5..386db456 100755 --- a/images/magic/info.json +++ b/images/magic/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "magic", "REPO_URL": "https://github.com/rtimothyedwards/magic", - "REPO_COMMIT": "73929a0bccd3083c3fe5c74b7ebf5a20d74bb4ee" + "REPO_COMMIT": "bfdf1227a704dbbfb78f42f69965ccc2c81989c1" } } \ No newline at end of file diff --git a/images/netgen/info.json b/images/netgen/info.json index e60f5dbc..ccee2f31 100755 --- a/images/netgen/info.json +++ b/images/netgen/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "netgen", "REPO_URL": "https://github.com/rtimothyedwards/netgen", - "REPO_COMMIT": "18dcac73bcb10455475826facbfdb4c25ce1a951" + "REPO_COMMIT": "cfdc60104b8487be153541697df476ca84598e4a" } } \ No newline at end of file diff --git a/images/ngscope/info.json b/images/ngscope/info.json index 0e62be67..9522f8db 100755 --- a/images/ngscope/info.json +++ b/images/ngscope/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "false", "BASE_IMAGE": "base", "NAME": "ngscope", - "REPO_URL": "none", + "REPO_URL": "n/a", "REPO_COMMIT": "0.9.5" } -} \ No newline at end of file +} diff --git a/images/ngspice/info.json b/images/ngspice/info.json index 74bdd0dc..b80cb8ce 100755 --- a/images/ngspice/info.json +++ b/images/ngspice/info.json @@ -1,8 +1,9 @@ { - "args" : { - "BASE_IMAGE" : "base", - "NAME": "ngspice", - "REPO_URL": "https://git.code.sf.net/p/ngspice/ngspice", - "REPO_COMMIT": "51cc21de1637d1abca1b361b756784e69a28cf76" - } -} + "args": { + "GIT": "true", + "BASE_IMAGE": "base", + "NAME": "ngspice", + "REPO_URL": "https://git.code.sf.net/p/ngspice/ngspice", + "REPO_COMMIT": "87b9df66816696c085007e5d7731bc457d6208ba" + } +} \ No newline at end of file diff --git a/images/open_pdks/info.json b/images/open_pdks/info.json index d1d18730..d678fb9a 100755 --- a/images/open_pdks/info.json +++ b/images/open_pdks/info.json @@ -1,5 +1,6 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "MAGIC_IMAGE": "magic", "NAME": "open_pdks", diff --git a/images/openlane/info.json b/images/openlane/info.json index b97ffcaf..0c79d9ee 100755 --- a/images/openlane/info.json +++ b/images/openlane/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "openlane", "REPO_URL": "https://github.com/The-OpenROAD-Project/OpenLane", - "REPO_COMMIT": "2021.09.23_03.17.13" + "REPO_COMMIT": "445acc69b3a1180533f7133fb1db08ab4fdedd9a" } } \ No newline at end of file diff --git a/images/riscv-gnu-toolchain-rv32i/info.json b/images/riscv-gnu-toolchain-rv32i/info.json index 1ba5966b..ccc2a841 100755 --- a/images/riscv-gnu-toolchain-rv32i/info.json +++ b/images/riscv-gnu-toolchain-rv32i/info.json @@ -1,8 +1,9 @@ { - "args" : { - "BASE_IMAGE" : "base", - "NAME": "riscv-gnu-toolchain-rv32i", - "REPO_URL": "https://github.com/riscv/riscv-gnu-toolchain", - "REPO_COMMIT": "411d134" - } -} + "args": { + "GIT": "true", + "BASE_IMAGE": "base", + "NAME": "riscv-gnu-toolchain-rv32i", + "REPO_URL": "https://github.com/riscv/riscv-gnu-toolchain", + "REPO_COMMIT": "b39e36160aa0649ba0dfb9aa314d375900d610fb" + } +} \ No newline at end of file diff --git a/images/skywater-pdk/info.json b/images/skywater-pdk/info.json index 740b800e..8f97dd64 100755 --- a/images/skywater-pdk/info.json +++ b/images/skywater-pdk/info.json @@ -1,8 +1,9 @@ { - "args" : { - "BASE_IMAGE" : "base", - "NAME": "skywater-pdk", - "REPO_URL": "https://github.com/google/skywater-pdk.git", - "REPO_COMMIT" : "c094b6e83a4f9298e47f696ec5a7fd53535ec5eb" - } -} + "args": { + "GIT": "true", + "BASE_IMAGE": "base", + "NAME": "skywater-pdk", + "REPO_URL": "https://github.com/google/skywater-pdk.git", + "REPO_COMMIT": "b5ff6174d9aa921f670f12a2893969fe4a516f6c" + } +} \ No newline at end of file diff --git a/images/xschem/info.json b/images/xschem/info.json index 712a0fa5..88b411be 100755 --- a/images/xschem/info.json +++ b/images/xschem/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "xschem", "REPO_URL": "https://github.com/StefanSchippers/xschem.git", - "REPO_COMMIT": "945368db9cf21c6a402260f6ee03350893a233ef" + "REPO_COMMIT": "de1db1e87a89efe9d8b69a1ac9fdf51eaa75b53a" } } \ No newline at end of file diff --git a/images/xyce/info.json b/images/xyce/info.json index 2fe6c71f..73154943 100755 --- a/images/xyce/info.json +++ b/images/xyce/info.json @@ -1,8 +1,9 @@ { "args": { + "GIT": "true", "BASE_IMAGE": "base", "NAME": "xyce", "REPO_URL": "https://github.com/Xyce/Xyce.git", - "REPO_COMMIT": "a157dbaa9516d5c218725f174b35f670b9e34131" + "REPO_COMMIT": "3f88510cc7108101ba461363fbb3c62523ef23c1" } -} +} \ No newline at end of file diff --git a/run.py b/run.py index 7459d9aa..4ae06f0f 100755 --- a/run.py +++ b/run.py @@ -52,6 +52,7 @@ def update(args): def handleRecipe(args): json_file = args.json csv_file = args.csv + update = args.update dict = None if json_file != None: @@ -60,15 +61,23 @@ def handleRecipe(args): dict = recipe.parseCsvFile(csv_file) images = recipe.parseRecipeDict(dict) - builder = DockerBuilder() - for image in images: - image.build_status = builder.build(image) + if update == True: + csv = "Name,Version\n" + for image in images: + image.update(updateFlag=True) + csv += f"{image.name},{image.version}\n" + with open(csv_file, "w") as file: + file.writelines(csv) + else: + builder = DockerBuilder() + for image in images: + image.build_status = builder.build(image) - for image in images: - status = "Fail" - if image.build_status == True: - status = "Success" - print("Image | {:^30} | {:10} ".format(image.name, status)) + for image in images: + status = "Fail" + if image.build_status == True: + status = "Success" + print("Image | {:^30} | {:10} ".format(image.name, status)) parser = argparse.ArgumentParser( @@ -92,6 +101,7 @@ def handleRecipe(args): help="recipe ") recipe_subparser.add_argument("--json", type=str) recipe_subparser.add_argument("--csv", type=str) +recipe_subparser.add_argument("--update", action="store_true") recipe_subparser.set_defaults(func=handleRecipe) args = parser.parse_args() diff --git a/src/image/image.py b/src/image/image.py index a1449972..25d1da05 100755 --- a/src/image/image.py +++ b/src/image/image.py @@ -17,6 +17,8 @@ def __init__(self, name, path, args, json_file, meta_data): self.version = self.args["REPO_COMMIT"] self.build_status = False + self.is_git = True if self.args["GIT"] == "true" else False + @classmethod def createFromPath(cls, path): @@ -25,6 +27,7 @@ def createFromPath(cls, path): return cls.createFromJSON(json_file) + @classmethod def createFromJSON(cls, json_file): f = open(json_file) @@ -46,10 +49,12 @@ def createFromJSON(cls, json_file): def getLatestVersion(self): - url = self.url - g = git.cmd.Git() - response = g.ls_remote(url, 'HEAD') - latest_version = response.split()[0] + latest_version = "" + if self.is_git == True: + url = self.url + g = git.cmd.Git() + response = g.ls_remote(url, 'HEAD') + latest_version = response.split()[0] return latest_version @@ -67,21 +72,25 @@ def updatePrompt(self, new_version): def update(self, updateFlag=False): - current_version = self.version - new_version = self.getLatestVersion() + if self.is_git == True: + current_version = self.version + new_version = self.getLatestVersion() - if (new_version != current_version): - if (updateFlag == True): - self.commitVersion(new_version) - else: - response = self.updatePrompt(new_version) - if (response == True): + if (new_version != current_version): + if (updateFlag == True): self.commitVersion(new_version) - print("New version commited!") + print(f"{self.name} updated to {self.version}") + else: + response = self.updatePrompt(new_version) + if (response == True): + self.commitVersion(new_version) + print(f"{self.name} updated to {self.version}") + else: + print("Latest version for (%s) synced.\n" + "Run install to install it.\n" + "Nothing to be done." % self.name) else: - print("Latest version for (%s) synced.\n" - "Run install to install it.\n" - "Nothing to be done." % self.name) + print(f"{self.name} is not git-based") def commitVersion(self, new_version): diff --git a/src/image/recipe.py b/src/image/recipe.py index dc04588d..be603b96 100755 --- a/src/image/recipe.py +++ b/src/image/recipe.py @@ -6,6 +6,18 @@ from .image import Image +def genRecipe(images): + csv = "Name,Version\n" + for image_name in images: + image_path = getImagePath(image_name) + image = Image.createFromPath(image_path) + version = image.version + csv += f"{image_name},{version}\n" + + return csv + + + def parseRecipeDict(recipe_dict): images = [] for item in recipe_dict: