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

Better error message sagemaker, better documentation server env vars #2885

Merged
merged 9 commits into from
Jul 29, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ The environment variables starting with _ZENML\_SERVER\_SECURE\_HEADERS\__\* can

The following secure headers environment variables are supported:

* _ZENML\_SERVER\_SECURE\_HEADERS\_SERVER_\*: The `Server` HTTP header value used to identify the server. The default value is the ZenML server ID.
* **ZENML\_SERVER\_SECURE\_HEADERS\_SERVER**: The `Server` HTTP header value used to identify the server. The default value is the ZenML server ID.
* **ZENML\_SERVER\_SECURE\_HEADERS\_HSTS**: The `Strict-Transport-Security` HTTP header value. The default value is `max-age=63072000; includeSubDomains`.
* **ZENML\_SERVER\_SECURE\_HEADERS\_XFO**: The `X-Frame-Options` HTTP header value. The default value is `SAMEORIGIN`.
* **ZENML\_SERVER\_SECURE\_HEADERS\_XXP**: The `X-XSS-Protection` HTTP header value. The default value is `0`. NOTE: this header is deprecated and should not be customized anymore. The `Content-Security-Policy` header should be used instead.
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 2024.06.06
_commit: 2024.07.26
_src_path: gh:zenml-io/template-starter
email: [email protected]
full_name: ZenML GmbH
Expand Down
8 changes: 4 additions & 4 deletions examples/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ zenml model list

This will show you a new `breast_cancer_classifier` model with two versions, `sgd` and `rf` created. You can find out how this was configured in the [YAML pipeline configuration files](configs/).

If you are a [ZenML Cloud](https://zenml.io/cloud) user, you can see all of this visualized in the dashboard:
If you are a [ZenML Pro](https://zenml.io/pro) user, you can see all of this visualized in the dashboard:

<img src=".assets/cloud_mcp_screenshot.png" width="70%" alt="Model Control Plane">

Expand All @@ -165,7 +165,7 @@ While we've demonstrated a manual promotion process for clarity, a more in-depth

<img src=".assets/cloud_mcp.png" width="60%" alt="Model Control Plane">

Again, if you are a [ZenML Cloud](https://zenml.io/cloud) user, you would be able to see all this in the cloud dashboard.
Again, if you are a [ZenML Pro](https://zenml.io/pro) user, you would be able to see all this in the cloud dashboard.

</details>

Expand All @@ -184,7 +184,7 @@ that were returned in the pipeline. This completes the MLOps loop of training to

<img src=".assets/inference_pipeline.png" width="45%" alt="Inference pipeline">

You can also see all predictions ever created as a complete history in the dashboard (Again only for [ZenML Cloud](https://zenml.io/cloud) users):
You can also see all predictions ever created as a complete history in the dashboard (Again only for [ZenML Pro](https://zenml.io/pro) users):

<img src=".assets/cloud_mcp_predictions.png" width="70%" alt="Model Control Plane">

Expand All @@ -203,7 +203,7 @@ If you want to learn more about ZenML as a tool, then the
to get started. In particular, the [Production Guide](https://docs.zenml.io/user-guide/production-guide/)
goes into more detail as to how to transition these same pipelines into production on the cloud.

The best way to get a production ZenML instance up and running with all batteries included is the [ZenML Cloud](https://zenml.io/cloud). Check it out!
The best way to get a production ZenML instance up and running with all batteries included is the [ZenML Pro](https://zenml.io/pro). Check it out!

Also, make sure to join our <a href="https://zenml.io/slack" target="_blank">
<img width="15" src="https://cdn3.iconfinder.com/data/icons/logos-and-brands-adobe/512/306_Slack-512.png" alt="Slack"/>
Expand Down
12 changes: 6 additions & 6 deletions examples/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@
"id": "966ce581",
"metadata": {},
"source": [
"## ☁️ Step 1: Connect to ZenML Cloud\n",
"## ☁️ Step 1: Connect to ZenML Pro\n",
"\n",
"If you are using [ZenML Cloud](https://zenml.io/cloud), execute the following\n",
"If you are using [ZenML Pro](https://zenml.io/pro), execute the following\n",
"cell with your tenant URL. Otherwise ignore.\n",
"\n",
"ZenML Cloud is a managed service that provides a hosted ZenML environment. It\n",
"ZenML Pro is a managed service that provides a hosted ZenML environment. It\n",
"allows you to run your pipelines on the cloud, manage your metadata, and\n",
"collaborate with your team. Sign up at [ZenML Cloud](https://zenml.io/cloud) for\n",
"collaborate with your team. Sign up [here](https://zenml.io/pro) for\n",
"a free trial and to get started!"
]
},
Expand Down Expand Up @@ -858,7 +858,7 @@
"id": "53517a9a",
"metadata": {},
"source": [
"If you are a [ZenML Cloud](https://zenml.io/cloud) user, you can see all of this visualized in the dashboard:\n",
"If you are a [ZenML Pro](https://zenml.io/pro) user, you can see all of this visualized in the dashboard:\n",
"\n",
"<img src=\".assets/cloud_mcp_screenshot.png\" width=\"70%\" alt=\"Model Control Plane\">"
]
Expand Down Expand Up @@ -1102,7 +1102,7 @@
"## What next?\n",
"\n",
"* If you have questions or feedback... join our [**Slack Community**](https://zenml.io/slack) and become part of the ZenML family!\n",
"* If you want to quickly get started with ZenML, check out the [ZenML Cloud](https://zenml.io/cloud)."
"* If you want to quickly get started with ZenML, check out [ZenML Pro](https://zenml.io/pro)."
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zenml[server]>=0.50.0
notebook
scikit-learn<1.3
scikit-learn
pyarrow
3 changes: 3 additions & 0 deletions src/zenml/config/server_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def generate_jwt_secret_key() -> str:
class ServerConfiguration(BaseModel):
"""ZenML Server configuration attributes.

All these attributes can be set through the environment with the `ZENML_SERVER_`-Prefix.
The value of the `ZENML_SERVER_DEPLOYMENT_TYPE` environment variable will be extracted to deployment_type.

Attributes:
deployment_type: The type of ZenML server deployment that is running.
server_url: The URL where the ZenML server API is reachable. Must be
Expand Down
17 changes: 13 additions & 4 deletions src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import boto3
import sagemaker
from botocore.exceptions import WaiterError
from sagemaker.network import NetworkConfig
from sagemaker.processing import ProcessingInput, ProcessingOutput
from sagemaker.workflow.execution_variables import ExecutionVariables
Expand Down Expand Up @@ -373,10 +374,18 @@ def prepare_or_run_pipeline(
logger.info(
"Executing synchronously. Waiting for pipeline to finish..."
)
pipeline_execution.wait(
delay=POLLING_DELAY, max_attempts=MAX_POLLING_ATTEMPTS
)
logger.info("Pipeline completed successfully.")
try:
pipeline_execution.wait(
delay=POLLING_DELAY, max_attempts=MAX_POLLING_ATTEMPTS
)
logger.info("Pipeline completed successfully.")
except WaiterError:
raise RuntimeError(
"Timed out while waiting for pipeline execution to finish. For long-running "
"pipelines we recommend configuring your orchestrator for asynchronous execution. "
"The following command does this for you: \n"
f"`zenml orchestrator update {self.name} --synchronous=False`"
)

def _get_region_name(self) -> str:
"""Returns the AWS region name.
Expand Down
Loading