Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for Placeholders for Sagemaker Processing container arguments #94

Closed
manshahe opened this issue Oct 6, 2020 · 3 comments
Assignees

Comments

@manshahe
Copy link

manshahe commented Oct 6, 2020

This is a feature request for the newly added stepfunctions.steps.sagemaker.ProcessingStep to accept placeholders for inputs to the container_argument parameter. An example case is depicted below:

execution_input = ExecutionInput(
    schema={
        "JobName": str,
        #This argument is for the Sagemaker Processing step
        "argument": str
    }
)

processing_step = ProcessingStep(
    job_name=execution_input["JobName"],
    processor={sagemaker processor object here},
    inputs=inputs,
    outputs = outputs,
    #Argument passed here to Sagemaker Processing
    container_arguments=['--argument', execution_input.get['argument'].to_jsonpath()],
    container_entrypoint=["python3", "/opt/ml/processing/input/code/scipt.py"]
)

Rationale: This will make the generated state machines more generic, we can generate 1 state machine and pass it arguments for different workloads. Without this functionality, I need to generate n state machines for a parameter which takes n possible values.

@manshahe manshahe changed the title Support for passing arguments from execution input to Sagemaker Processing container_arguments Feature Request: Support for passing arguments from execution input to Sagemaker Processing container arguments Oct 6, 2020
@manshahe manshahe changed the title Feature Request: Support for passing arguments from execution input to Sagemaker Processing container arguments Feature Request: Support for Placeholders for Sagemaker Processing container arguments Nov 24, 2020
@ca-nguyen ca-nguyen self-assigned this Aug 17, 2021
@wong-a
Copy link
Contributor

wong-a commented Aug 18, 2021

Creating an array with placeholder values for specific elements will require using the States.Array intrinsic function unless the referenced JSONPath value is an array.

"AppSpecification.ContainerArguments.$": "States.Array('--argument', $.argument)"

@ca-nguyen
Copy link
Contributor

The fix to support placeholders (#155) will be available in next release.

@yanhong-zhao-ef
Copy link

I am wondering if we can re-open this issue since the original feature request is still not possible where execution_input['argument'].to_jsonpath() will get passed straight to the processing script without the variable being replaced on execution and execution_input['argument'] runs into TypeError: Object of type ExecutionInput is not JSON serializable when trying to create workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants