Skip to content

Commit

Permalink
added a docker compose for a 'remote deployment' but locally
Browse files Browse the repository at this point in the history
  • Loading branch information
phitoduck committed Sep 21, 2024
1 parent 02e68f7 commit 927125f
Show file tree
Hide file tree
Showing 6 changed files with 362 additions and 30 deletions.
222 changes: 222 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# https://github.com/github/gitignore/blob/main/Python.gitignore

./zenml
./zenml_
./volumes

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -176,3 +178,223 @@ dist
*env
*.env
*cache*
volumes/mysql/data/#ib_16384_0.dblwr
volumes/mysql/data/#ib_16384_1.dblwr
volumes/mysql/data/auto.cnf
volumes/mysql/data/binlog.000001
volumes/mysql/data/binlog.000002
volumes/mysql/data/binlog.index
volumes/mysql/data/ca-key.pem
volumes/mysql/data/ca.pem
volumes/mysql/data/client-cert.pem
volumes/mysql/data/client-key.pem
volumes/mysql/data/ib_buffer_pool
volumes/mysql/data/ibdata1
volumes/mysql/data/ibtmp1
volumes/mysql/data/mysql.ibd
volumes/mysql/data/mysql.sock
volumes/mysql/data/private_key.pem
volumes/mysql/data/public_key.pem
volumes/mysql/data/server-cert.pem
volumes/mysql/data/server-key.pem
volumes/mysql/data/undo_001
volumes/mysql/data/undo_002
volumes/mysql/data/#innodb_redo/#ib_redo9
volumes/mysql/data/#innodb_redo/#ib_redo10
volumes/mysql/data/#innodb_redo/#ib_redo11_tmp
volumes/mysql/data/#innodb_redo/#ib_redo12_tmp
volumes/mysql/data/#innodb_redo/#ib_redo13_tmp
volumes/mysql/data/#innodb_redo/#ib_redo14_tmp
volumes/mysql/data/#innodb_redo/#ib_redo15_tmp
volumes/mysql/data/#innodb_redo/#ib_redo16_tmp
volumes/mysql/data/#innodb_redo/#ib_redo17_tmp
volumes/mysql/data/#innodb_redo/#ib_redo18_tmp
volumes/mysql/data/#innodb_redo/#ib_redo19_tmp
volumes/mysql/data/#innodb_redo/#ib_redo20_tmp
volumes/mysql/data/#innodb_redo/#ib_redo21_tmp
volumes/mysql/data/#innodb_redo/#ib_redo22_tmp
volumes/mysql/data/#innodb_redo/#ib_redo23_tmp
volumes/mysql/data/#innodb_redo/#ib_redo24_tmp
volumes/mysql/data/#innodb_redo/#ib_redo25_tmp
volumes/mysql/data/#innodb_redo/#ib_redo26_tmp
volumes/mysql/data/#innodb_redo/#ib_redo27_tmp
volumes/mysql/data/#innodb_redo/#ib_redo28_tmp
volumes/mysql/data/#innodb_redo/#ib_redo29_tmp
volumes/mysql/data/#innodb_redo/#ib_redo30_tmp
volumes/mysql/data/#innodb_redo/#ib_redo31_tmp
volumes/mysql/data/#innodb_redo/#ib_redo32_tmp
volumes/mysql/data/#innodb_redo/#ib_redo33_tmp
volumes/mysql/data/#innodb_redo/#ib_redo34_tmp
volumes/mysql/data/#innodb_redo/#ib_redo35_tmp
volumes/mysql/data/#innodb_redo/#ib_redo36_tmp
volumes/mysql/data/#innodb_redo/#ib_redo37_tmp
volumes/mysql/data/#innodb_redo/#ib_redo38_tmp
volumes/mysql/data/#innodb_redo/#ib_redo39_tmp
volumes/mysql/data/#innodb_redo/#ib_redo40_tmp
volumes/mysql/data/#innodb_temp/temp_1.ibt
volumes/mysql/data/#innodb_temp/temp_2.ibt
volumes/mysql/data/#innodb_temp/temp_3.ibt
volumes/mysql/data/#innodb_temp/temp_4.ibt
volumes/mysql/data/#innodb_temp/temp_5.ibt
volumes/mysql/data/#innodb_temp/temp_6.ibt
volumes/mysql/data/#innodb_temp/temp_7.ibt
volumes/mysql/data/#innodb_temp/temp_8.ibt
volumes/mysql/data/#innodb_temp/temp_9.ibt
volumes/mysql/data/#innodb_temp/temp_10.ibt
volumes/mysql/data/mysql/general_log_213.sdi
volumes/mysql/data/mysql/general_log.CSM
volumes/mysql/data/mysql/general_log.CSV
volumes/mysql/data/mysql/slow_log_214.sdi
volumes/mysql/data/mysql/slow_log.CSM
volumes/mysql/data/mysql/slow_log.CSV
volumes/mysql/data/performance_schema/accounts_145.sdi
volumes/mysql/data/performance_schema/binary_log_trans_189.sdi
volumes/mysql/data/performance_schema/cond_instances_82.sdi
volumes/mysql/data/performance_schema/data_lock_waits_161.sdi
volumes/mysql/data/performance_schema/data_locks_160.sdi
volumes/mysql/data/performance_schema/error_log_83.sdi
volumes/mysql/data/performance_schema/events_errors_su_139.sdi
volumes/mysql/data/performance_schema/events_errors_su_140.sdi
volumes/mysql/data/performance_schema/events_errors_su_141.sdi
volumes/mysql/data/performance_schema/events_errors_su_142.sdi
volumes/mysql/data/performance_schema/events_errors_su_143.sdi
volumes/mysql/data/performance_schema/events_stages_cu_111.sdi
volumes/mysql/data/performance_schema/events_stages_hi_112.sdi
volumes/mysql/data/performance_schema/events_stages_hi_113.sdi
volumes/mysql/data/performance_schema/events_stages_su_114.sdi
volumes/mysql/data/performance_schema/events_stages_su_115.sdi
volumes/mysql/data/performance_schema/events_stages_su_116.sdi
volumes/mysql/data/performance_schema/events_stages_su_117.sdi
volumes/mysql/data/performance_schema/events_stages_su_118.sdi
volumes/mysql/data/performance_schema/events_statement_119.sdi
volumes/mysql/data/performance_schema/events_statement_120.sdi
volumes/mysql/data/performance_schema/events_statement_121.sdi
volumes/mysql/data/performance_schema/events_statement_122.sdi
volumes/mysql/data/performance_schema/events_statement_123.sdi
volumes/mysql/data/performance_schema/events_statement_124.sdi
volumes/mysql/data/performance_schema/events_statement_125.sdi
volumes/mysql/data/performance_schema/events_statement_126.sdi
volumes/mysql/data/performance_schema/events_statement_127.sdi
volumes/mysql/data/performance_schema/events_statement_128.sdi
volumes/mysql/data/performance_schema/events_statement_129.sdi
volumes/mysql/data/performance_schema/events_statement_130.sdi
volumes/mysql/data/performance_schema/events_transacti_131.sdi
volumes/mysql/data/performance_schema/events_transacti_132.sdi
volumes/mysql/data/performance_schema/events_transacti_133.sdi
volumes/mysql/data/performance_schema/events_transacti_134.sdi
volumes/mysql/data/performance_schema/events_transacti_135.sdi
volumes/mysql/data/performance_schema/events_transacti_136.sdi
volumes/mysql/data/performance_schema/events_transacti_137.sdi
volumes/mysql/data/performance_schema/events_transacti_138.sdi
volumes/mysql/data/performance_schema/events_waits_cur_84.sdi
volumes/mysql/data/performance_schema/events_waits_his_85.sdi
volumes/mysql/data/performance_schema/events_waits_his_86.sdi
volumes/mysql/data/performance_schema/events_waits_sum_87.sdi
volumes/mysql/data/performance_schema/events_waits_sum_88.sdi
volumes/mysql/data/performance_schema/events_waits_sum_89.sdi
volumes/mysql/data/performance_schema/events_waits_sum_90.sdi
volumes/mysql/data/performance_schema/events_waits_sum_91.sdi
volumes/mysql/data/performance_schema/events_waits_sum_92.sdi
volumes/mysql/data/performance_schema/file_instances_93.sdi
volumes/mysql/data/performance_schema/file_summary_by__94.sdi
volumes/mysql/data/performance_schema/file_summary_by__95.sdi
volumes/mysql/data/performance_schema/global_status_181.sdi
volumes/mysql/data/performance_schema/global_variables_184.sdi
volumes/mysql/data/performance_schema/hosts_146.sdi
volumes/mysql/data/performance_schema/keyring_componen_191.sdi
volumes/mysql/data/performance_schema/keyring_keys_152.sdi
volumes/mysql/data/performance_schema/log_status_174.sdi
volumes/mysql/data/performance_schema/memory_summary_b_154.sdi
volumes/mysql/data/performance_schema/memory_summary_b_155.sdi
volumes/mysql/data/performance_schema/memory_summary_b_156.sdi
volumes/mysql/data/performance_schema/memory_summary_b_157.sdi
volumes/mysql/data/performance_schema/memory_summary_g_153.sdi
volumes/mysql/data/performance_schema/metadata_locks_159.sdi
volumes/mysql/data/performance_schema/mutex_instances_97.sdi
volumes/mysql/data/performance_schema/objects_summary__98.sdi
volumes/mysql/data/performance_schema/performance_time_99.sdi
volumes/mysql/data/performance_schema/persisted_variab_187.sdi
volumes/mysql/data/performance_schema/prepared_stateme_175.sdi
volumes/mysql/data/performance_schema/processlist_100.sdi
volumes/mysql/data/performance_schema/replication_appl_165.sdi
volumes/mysql/data/performance_schema/replication_appl_166.sdi
volumes/mysql/data/performance_schema/replication_appl_167.sdi
volumes/mysql/data/performance_schema/replication_appl_168.sdi
volumes/mysql/data/performance_schema/replication_appl_170.sdi
volumes/mysql/data/performance_schema/replication_appl_171.sdi
volumes/mysql/data/performance_schema/replication_asyn_172.sdi
volumes/mysql/data/performance_schema/replication_asyn_173.sdi
volumes/mysql/data/performance_schema/replication_conn_162.sdi
volumes/mysql/data/performance_schema/replication_conn_164.sdi
volumes/mysql/data/performance_schema/replication_grou_163.sdi
volumes/mysql/data/performance_schema/replication_grou_169.sdi
volumes/mysql/data/performance_schema/rwlock_instances_101.sdi
volumes/mysql/data/performance_schema/session_account__151.sdi
volumes/mysql/data/performance_schema/session_connect__150.sdi
volumes/mysql/data/performance_schema/session_status_182.sdi
volumes/mysql/data/performance_schema/session_variable_185.sdi
volumes/mysql/data/performance_schema/setup_actors_102.sdi
volumes/mysql/data/performance_schema/setup_consumers_103.sdi
volumes/mysql/data/performance_schema/setup_instrument_104.sdi
volumes/mysql/data/performance_schema/setup_objects_105.sdi
volumes/mysql/data/performance_schema/setup_threads_106.sdi
volumes/mysql/data/performance_schema/socket_instances_147.sdi
volumes/mysql/data/performance_schema/socket_summary_b_148.sdi
volumes/mysql/data/performance_schema/socket_summary_b_149.sdi
volumes/mysql/data/performance_schema/status_by_accoun_177.sdi
volumes/mysql/data/performance_schema/status_by_host_178.sdi
volumes/mysql/data/performance_schema/status_by_thread_179.sdi
volumes/mysql/data/performance_schema/status_by_user_180.sdi
volumes/mysql/data/performance_schema/table_handles_158.sdi
volumes/mysql/data/performance_schema/table_io_waits_s_107.sdi
volumes/mysql/data/performance_schema/table_io_waits_s_108.sdi
volumes/mysql/data/performance_schema/table_lock_waits_109.sdi
volumes/mysql/data/performance_schema/threads_110.sdi
volumes/mysql/data/performance_schema/tls_channel_stat_190.sdi
volumes/mysql/data/performance_schema/user_defined_fun_188.sdi
volumes/mysql/data/performance_schema/user_variables_b_176.sdi
volumes/mysql/data/performance_schema/users_144.sdi
volumes/mysql/data/performance_schema/variables_by_thr_183.sdi
volumes/mysql/data/performance_schema/variables_info_186.sdi
volumes/mysql/data/sys/sys_config.ibd
volumes/mysql/data/zenml/action.ibd
volumes/mysql/data/zenml/alembic_version.ibd
volumes/mysql/data/zenml/api_key.ibd
volumes/mysql/data/zenml/artifact_version.ibd
volumes/mysql/data/zenml/artifact_visualization.ibd
volumes/mysql/data/zenml/artifact.ibd
volumes/mysql/data/zenml/auth_devices.ibd
volumes/mysql/data/zenml/code_reference.ibd
volumes/mysql/data/zenml/code_repository.ibd
volumes/mysql/data/zenml/event_source.ibd
volumes/mysql/data/zenml/flavor.ibd
volumes/mysql/data/zenml/logs.ibd
volumes/mysql/data/zenml/model_version.ibd
volumes/mysql/data/zenml/model_versions_artifacts.ibd
volumes/mysql/data/zenml/model_versions_runs.ibd
volumes/mysql/data/zenml/model.ibd
volumes/mysql/data/zenml/pipeline_build.ibd
volumes/mysql/data/zenml/pipeline_deployment.ibd
volumes/mysql/data/zenml/pipeline_run.ibd
volumes/mysql/data/zenml/pipeline.ibd
volumes/mysql/data/zenml/run_metadata.ibd
volumes/mysql/data/zenml/run_template.ibd
volumes/mysql/data/zenml/schedule.ibd
volumes/mysql/data/zenml/secret.ibd
volumes/mysql/data/zenml/server_settings.ibd
volumes/mysql/data/zenml/service_connector.ibd
volumes/mysql/data/zenml/service.ibd
volumes/mysql/data/zenml/stack_component.ibd
volumes/mysql/data/zenml/stack_composition.ibd
volumes/mysql/data/zenml/stack.ibd
volumes/mysql/data/zenml/step_run_input_artifact.ibd
volumes/mysql/data/zenml/step_run_output_artifact.ibd
volumes/mysql/data/zenml/step_run_parents.ibd
volumes/mysql/data/zenml/step_run.ibd
volumes/mysql/data/zenml/tag_resource.ibd
volumes/mysql/data/zenml/tag.ibd
volumes/mysql/data/zenml/trigger_execution.ibd
volumes/mysql/data/zenml/trigger.ibd
volumes/mysql/data/zenml/user.ibd
volumes/mysql/data/zenml/workspace.ibd
.zen/config.yaml
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@
## Usage

### Development with remote deployment

```bash
# re-deploy the EC2 instance stack
cd iac
make install
cdk deploy --app 'python app.py' --region us-west-2 --profile zenml

# auth with the deployed zenml server
zenml connect --server-url http://<ec2 ip>:8080

# create our zenml components and stack
./setup-zenml.sh
```

### Clean it up so no one can hack us

```bash
cdk destroy --app 'python app.py' --region us-west-2 --profile zenml
```

### Local development

```bash
docker-compose up
zenml connect --server-url http://localhost:8080
./setup-zenml.sh
```

## ZenML OSS vs Metaflow OSS

| Feature | ZenML OSS | Metaflow OSS |
| --- | - | - |
| Preview Artifacts in the UI |||
| Arbitrary visualizations in UI | | ✅ (metaflow cards) |
| Trigger DAGs from the UI || ❌ (seems like not based on [this](https://github.com/Netflix/metaflow-ui/blob/master/README.mds)) |
| List/Preview Artifacts in the UI |||
| Arbitrary visualizations in UI | | ✅ (metaflow cards) |
| Trigger DAGs from the UI || ❌ (seems like no based on [this](https://github.com/Netflix/metaflow-ui/blob/master/README.mds)) |
| Deploy Models from the UI |||
| Build and push docker images || ❌ (possibly with netflix extensions) |
| Stream logs to UI during DAG run |||
| Can abort DAG mid run from UI | ??? ||
| Build and push docker images for you, per step | ⚠️ (not during local development, only when using remote orchestrator) | ❌ (possibly with netflix extensions) |
| Easy switch from local to cloud |||
| Run only certain steps on cloud, others locally |||
| Favor running steps on prem, burst to cloud | ❌ (SkyPilot supports this, but ZenML's integration does not) | ✅ (with kubernetes) |
| Run DAGs on Airflow |||
| Run DAGs on Step Functions + AWS Batch |||
| No limit to number of collaborators | ??? ||
| Thin client | ❌ (55 deps) | ✅ (3 deps) |
| Simple control plane architecture | ✅ (zenml-server, mysql, simple IaC) | ❌ (postgres, backend, frontend, complex IaC) |
| supports proper Python packaging structure e.g. `pyproject.toml` for the DAG project | ??? ||



> The advantage of Skypilot is that it simply provisions a VM to execute the pipeline on your cloud provider. [Reference](https://docs.zenml.io/user-guide/production-guide/cloud-orchestration#starting-with-a-basic-cloud-stack)
- Does this mean that we CAN NOT have each step be deployed onto its own VM?

> When a pipeline is run with a remote orchestrator a Dockerfile is dynamically generated at runtime.
- So we can't have Docker images built and run one after another when developing locally?
- Does this also mean that we CAN NOT have a DAG where one step has pandas 1.1.1 and another has pandas 1.1.2? How can we have this if we can't have isolated environments per step *locally*?
35 changes: 35 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
mysql:
image: mysql:8.0
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- ./volumes/mysql/data/:/var/lib/mysql
- ./volumes/mysql/backups/:/backups
# TODO: mount the mysql state as a volume

zenml:
image: zenmldocker/zenml-server
ports:
- "8080:8080"
environment:
ZENML_STORE_URL: mysql://root:password@mysql/zenml
ZENML_STORE_BACKUP_DIRECTORY: /backups
ZENML_STORE_BACKUP_STRATEGY: dump-file
ZENML_SERVER_AUTO_ACTIVATE: 1
ZENML_DEFAULT_USER_NAME: default
ZENML_ENABLE_IMPLICIT_AUTH_METHODS: "true"
AWS_PROFILE: zenml
# ZENML_DEFAULT_USER_PASSWORD: The password to use for the initial admin user account. Defaults to an empty password value, if not set.
volumes:
- ~/.aws:/home/zenml/.aws
- ./volumes/mysql/data/:/var/lib/mysql
links:
- mysql
depends_on:
- mysql
# extra_hosts:
# - "host.docker.internal:host-gateway"
restart: on-failure
21 changes: 0 additions & 21 deletions iac/src/iac/docker-compose.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
zenml[server]
sagemaker>=2.117.0
kubernetes
aws-profile-manager
Loading

0 comments on commit 927125f

Please sign in to comment.