Skip to content
Snippets Groups Projects
Commit 48980057 authored by dilawar's avatar dilawar :ant:
Browse files

fix: the pipeline file can't have variant data

Such a tempdir.
parent c4aa5d5a
No related branches found
No related tags found
1 merge request!2version 0.2.0
Pipeline #3759 failed with stages
in 1 minute and 52 seconds
...@@ -110,6 +110,12 @@ def submit_pipeline(user_input: str, rerun: bool = False): ...@@ -110,6 +110,12 @@ def submit_pipeline(user_input: str, rerun: bool = False):
return containers return containers
@app.command("checksum")
def checksum(user_input):
pipeline = bpipeline.user_input_to_pipeline(user_input)
print(pipeline.checksum)
@app.command("run") @app.command("run")
@session @session
def run_pipeline(user_input: str, *, rerun: bool = False): def run_pipeline(user_input: str, *, rerun: bool = False):
......
...@@ -42,7 +42,7 @@ class Pipeline: ...@@ -42,7 +42,7 @@ class Pipeline:
return self.hash return self.hash
@classmethod @classmethod
def from_command(cls, cmd: str, comment: str = "") -> "Pipeline": def from_command(cls, cmd: str, *, comment: str = "") -> "Pipeline":
"""Create a pipeline from user command. The semantics is a bit different """Create a pipeline from user command. The semantics is a bit different
for this. for this.
""" """
...@@ -79,9 +79,7 @@ class Pipeline: ...@@ -79,9 +79,7 @@ class Pipeline:
"""Create pipeline from a directory""" """Create pipeline from a directory"""
dinfo = dir_info(user_dir) dinfo = dir_info(user_dir)
content_hash = dirhash(user_dir) content_hash = dirhash(user_dir)
outfile = ( outfile = bconfig.bitia_dir() / "pipelines" / f"{content_hash}.zip"
bconfig.bitia_dir() / "pipelines" / f"{content_hash}-{user_dir.name}.zip"
)
if not outfile.is_file(): if not outfile.is_file():
logger.info(f"Preparing the zipfile pipeline from {user_dir}") logger.info(f"Preparing the zipfile pipeline from {user_dir}")
logger.info( logger.info(
......
...@@ -18,6 +18,7 @@ def test_pipeline_singleton(): ...@@ -18,6 +18,7 @@ def test_pipeline_singleton():
p1 = Pipeline.from_command(u1) p1 = Pipeline.from_command(u1)
p2 = Pipeline.from_command(u1) p2 = Pipeline.from_command(u1)
assert p1 == p2 assert p1 == p2
p3 = Pipeline.from_command(u2) p3 = Pipeline.from_command(u2)
p4 = Pipeline.from_command(u2) p4 = Pipeline.from_command(u2)
assert p3 == p4 assert p3 == p4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment