Skip to content

Instantly share code, notes, and snippets.

@swiftdiaries
Created August 7, 2019 02:27
Show Gist options
  • Save swiftdiaries/03ae7605a0167955d3842c1726c9ced0 to your computer and use it in GitHub Desktop.
Save swiftdiaries/03ae7605a0167955d3842c1726c9ced0 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import kfp\n",
"import os"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"client = kfp.Client()\n",
"import datetime\n",
"iteration = datetime.datetime.now().strftime('%Y%m%d%H%M%S')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if os.getenv(\"ML_PIPELINE_SERVICE_PORT\"):\n",
" try: \n",
" client.get_experiment(experiment_name='Hybrid Pipelines - The One with the Two steps')\n",
" except:\n",
" hybrid_experiment = client.create_experiment(name='Hybrid Pipelines - The One with the Two steps')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if os.getenv(\"ML_PIPELINE_SERVICE_PORT\"):\n",
" run = client.run_pipeline(client.get_experiment(experiment_name='Hybrid Pipelines - The One with the Two steps').id, \n",
" 'hybrid_pipeline-'+str(iteration), 'hybrid_pipeline.tar.gz', \n",
" params={})\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment