diff --git a/nb2workflow/container.py b/nb2workflow/container.py index ea689ee..a9c3662 100644 --- a/nb2workflow/container.py +++ b/nb2workflow/container.py @@ -34,8 +34,7 @@ def import_repo(repo_source, target): return checksumdir.dirhash(target) -def prepare_image(repo_source, from_image, service=True, nb2w_path=None, runprefix="", - entrypoint=None, extra_docker_commands=[]): +def prepare_image(repo_source, from_image, service=True, nb2w_path=None, runprefix="", entrypoint=None): tempdir = tempfile.mkdtemp() @@ -48,8 +47,6 @@ def prepare_image(repo_source, from_image, service=True, nb2w_path=None, runpref dockerfile.append("FROM {}".format(from_image)) dockerfile.append("ARG REPO_PATH=./{}".format(rel_repo_path)) - for ec in extra_docker_commands: - dockerfile.append(ec) pipconf = os.path.join(repo_path, 'pip.conf') logger.info("using pipconf %s", pipconf) @@ -97,19 +94,15 @@ def prepare_image(repo_source, from_image, service=True, nb2w_path=None, runpref return tempdir -def build_image(tempdir, tag_image, nb2workflow_revision, extra_arguments=None): +def build_image(tempdir, tag_image, nb2workflow_revision): cli = docker.from_env() - buildargs=dict(nb2workflow_revision=nb2workflow_revision) - if extra_arguments is not None: - buildargs.update(extra_arguments) - print("-- building image, tagging as", tag_image) r = cli.api.build( path=tempdir, tag=tag_image, quiet=False, - buildargs=buildargs, + buildargs=dict(nb2workflow_revision=nb2workflow_revision), # stream=True, rm=True, ) @@ -144,8 +137,6 @@ def main(): metavar='location', type=str, default=None) parser.add_argument('--docker-command', type=str, default=None) parser.add_argument('--entrypoint', type=str, default=None) - parser.add_argument('--extra-docker-commands', type=str, default=None) - parser.add_argument('--extra-build-arguments', type=str, default=None) args = parser.parse_args() @@ -160,18 +151,12 @@ def main(): if args.tag_image == "": tag_image = os.path.basename(os.path.abspath(repo_path)) - extra_docker_commands=[] - if args.extra_docker_commands is not None: - #print("Extra Docker command is ", args.extra_docker_commands) - extra_docker_commands= args.extra_docker_commands.split(';') - tempdir = prepare_image( repo_path, args.from_image, service=not args.job, nb2w_path=args.nb2wpath, runprefix=args.docker_run_prefix, entrypoint=args.entrypoint, - extra_docker_commands=extra_docker_commands ) if args.store_dockerfile: @@ -179,10 +164,7 @@ def main(): print("\033[31mstored Dockerfile as\033[0m", args.store_dockerfile) if args.build: - extra_build_arguments=None - if args.extra_build_arguments is not None: - extra_build_arguments = json.loads(args.extra_build_arguments) - build_result = build_image(tempdir, tag_image, args.nb2wrev, extra_build_arguments) + build_result = build_image(tempdir, tag_image, args.nb2wrev) if build_result is None: raise Exception("failed to build") diff --git a/nb2workflow/nbadapter.py b/nb2workflow/nbadapter.py index 6b25a0c..4d9b96b 100644 --- a/nb2workflow/nbadapter.py +++ b/nb2workflow/nbadapter.py @@ -509,7 +509,6 @@ def extract_parameters(self): ('parameters', 'input_parameters'), ('system-parameters', 'system_parameters'), ('injected-parameters', 'input_parameters'), - ('refs', 'source_parameters'), ]: if tag in cell.metadata.get('tags', []): pars = self.extract_parameters_from_cell(cell)