├── .coveragerc ├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── new_feature.md │ └── report_bug.md ├── pull_request_template.md └── workflows │ ├── ai_flow_cd.yml │ ├── flink_ai_flow_ci.yml │ └── publish_ai_flow_image.yaml ├── .gitignore ├── .readthedocs.yaml ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── NOTICE ├── README.md ├── ai_flow ├── __init__.py ├── __main__.py ├── alembic.ini ├── blob_manager │ ├── __init__.py │ ├── blob_manager_interface.py │ └── impl │ │ ├── __init__.py │ │ ├── hdfs_blob_manager.py │ │ ├── local_blob_manager.py │ │ ├── oss_blob_manager.py │ │ └── s3_blob_manager.py ├── cli │ ├── __init__.py │ ├── cli_parser.py │ ├── commands │ │ ├── __init__.py │ │ ├── config_command.py │ │ ├── db_command.py │ │ ├── namespace_command.py │ │ ├── server_command.py │ │ ├── task_execution_command.py │ │ ├── task_manager_command.py │ │ ├── version_command.py │ │ ├── workflow_command.py │ │ ├── workflow_execution_command.py │ │ ├── workflow_schedule_command.py │ │ └── workflow_trigger_command.py │ └── simple_table.py ├── common │ ├── __init__.py │ ├── configuration │ │ ├── __init__.py │ │ ├── config_constants.py │ │ ├── config_templates │ │ │ ├── __init__.py │ │ │ ├── aiflow_client.yaml │ │ │ └── aiflow_server.yaml │ │ ├── configuration.py │ │ └── helpers.py │ ├── entity.py │ ├── env.py │ ├── exception │ │ ├── __init__.py │ │ └── exceptions.py │ ├── properties.py │ ├── result.py │ └── util │ │ ├── __init__.py │ │ ├── cli_utils.py │ │ ├── db_util │ │ ├── __init__.py │ │ ├── db_migration.py │ │ ├── orm_event_handlers.py │ │ └── session.py │ │ ├── file_util │ │ ├── __init__.py │ │ ├── hash_util.py │ │ ├── yaml_utils.py │ │ └── zip_file_util.py │ │ ├── json_utils.py │ │ ├── kubernetes_util.py │ │ ├── local_registry.py │ │ ├── log_util │ │ ├── __init__.py │ │ ├── file_task_handler.py │ │ ├── log_writer.py │ │ └── logging.py │ │ ├── mock_context.py │ │ ├── module_utils.py │ │ ├── net_utils.py │ │ ├── process_utils.py │ │ ├── string_utils.py │ │ ├── thread_utils.py │ │ ├── time_utils.py │ │ └── workflow_utils.py ├── frontend │ ├── .browserslistrc │ ├── .editorconfig │ ├── .env │ ├── .env.development │ ├── .env.preview │ ├── .eslintrc.js │ ├── .gitattributes │ ├── .gitignore │ ├── .prettierrc │ ├── .travis.yml │ ├── LICENSE │ ├── __init__.py │ ├── babel.config.js │ ├── compile_frontend.sh │ ├── config │ │ ├── plugin.config.js │ │ └── themePluginConfig.js │ ├── jest.config.js │ ├── jsconfig.json │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── index.html │ │ └── logo.png │ ├── src │ │ ├── App.vue │ │ ├── api │ │ │ ├── login.js │ │ │ └── manage.js │ │ ├── assets │ │ │ ├── background.svg │ │ │ ├── icons │ │ │ │ └── bx-analyse.svg │ │ │ ├── logo.svg │ │ │ └── style │ │ │ │ └── reset.css │ │ ├── components │ │ │ ├── AvatarList │ │ │ │ ├── Item.jsx │ │ │ │ ├── List.jsx │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ │ ├── Dialog.js │ │ │ ├── Ellipsis │ │ │ │ ├── Ellipsis.vue │ │ │ │ └── index.js │ │ │ ├── FooterToolbar │ │ │ │ ├── FooterToolBar.vue │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ │ ├── GlobalFooter │ │ │ │ └── index.vue │ │ │ ├── GlobalHeader │ │ │ │ ├── AvatarDropdown.vue │ │ │ │ └── RightContent.vue │ │ │ ├── Graph │ │ │ │ ├── FlowChart.vue │ │ │ │ ├── Relation.vue │ │ │ │ └── color.styl │ │ │ ├── IconSelector │ │ │ │ ├── IconSelector.vue │ │ │ │ ├── icons.js │ │ │ │ └── index.js │ │ │ ├── MultiTab │ │ │ │ ├── MultiTab.vue │ │ │ │ ├── events.js │ │ │ │ ├── index.js │ │ │ │ └── index.less │ │ │ ├── NProgress │ │ │ │ └── nprogress.less │ │ │ ├── NoticeIcon │ │ │ │ ├── NoticeIcon.vue │ │ │ │ └── index.js │ │ │ ├── PageLoading │ │ │ │ └── index.jsx │ │ │ ├── Search │ │ │ │ ├── GlobalSearch.jsx │ │ │ │ └── index.less │ │ │ ├── SelectLang │ │ │ │ ├── index.jsx │ │ │ │ └── index.less │ │ │ ├── SettingDrawer │ │ │ │ ├── SettingDrawer.vue │ │ │ │ ├── SettingItem.vue │ │ │ │ ├── index.js │ │ │ │ ├── settingConfig.js │ │ │ │ └── themeColor.js │ │ │ ├── StandardFormRow │ │ │ │ ├── StandardFormRow.vue │ │ │ │ └── index.js │ │ │ ├── Table │ │ │ │ └── index.js │ │ │ ├── _util │ │ │ │ └── util.js │ │ │ ├── index.js │ │ │ └── index.less │ │ ├── config │ │ │ ├── defaultSettings.js │ │ │ └── router.config.js │ │ ├── core │ │ │ ├── bootstrap.js │ │ │ ├── directives │ │ │ │ └── action.js │ │ │ ├── icons.js │ │ │ ├── lazy_use.js │ │ │ ├── permission │ │ │ │ └── permission.js │ │ │ └── use.js │ │ ├── global.less │ │ ├── layouts │ │ │ ├── BasicLayout.less │ │ │ ├── BasicLayout.vue │ │ │ ├── BlankLayout.vue │ │ │ ├── PageView.vue │ │ │ ├── RouteView.vue │ │ │ ├── UserLayout.vue │ │ │ └── index.js │ │ ├── locales │ │ │ ├── index.js │ │ │ └── lang │ │ │ │ ├── en-US.js │ │ │ │ └── en-US │ │ │ │ ├── menu.js │ │ │ │ ├── setting.js │ │ │ │ └── user.js │ │ ├── main.js │ │ ├── mock │ │ │ ├── index.js │ │ │ ├── services │ │ │ │ ├── auth.js │ │ │ │ └── user.js │ │ │ └── util.js │ │ ├── permission.js │ │ ├── router │ │ │ ├── generator-routers.js │ │ │ └── index.js │ │ ├── store │ │ │ ├── app-mixin.js │ │ │ ├── device-mixin.js │ │ │ ├── getters.js │ │ │ ├── i18n-mixin.js │ │ │ ├── index.js │ │ │ ├── modules │ │ │ │ ├── app.js │ │ │ │ ├── async-router.js │ │ │ │ ├── permission.js │ │ │ │ └── user.js │ │ │ └── mutation-types.js │ │ ├── utils │ │ │ ├── axios.js │ │ │ ├── domUtil.js │ │ │ ├── filter.js │ │ │ ├── request.js │ │ │ ├── routeConvert.js │ │ │ ├── screenLog.js │ │ │ ├── util.js │ │ │ └── utils.less │ │ └── views │ │ │ ├── 404.vue │ │ │ ├── exception │ │ │ ├── 403.vue │ │ │ ├── 404.vue │ │ │ └── 500.vue │ │ │ ├── metadata │ │ │ ├── Artifact.vue │ │ │ ├── Dataset.vue │ │ │ ├── Graph.vue │ │ │ ├── JobExecution.vue │ │ │ ├── Model.vue │ │ │ ├── ModelVersion.vue │ │ │ ├── Project.vue │ │ │ ├── Workflow.vue │ │ │ └── WorkflowExecution.vue │ │ │ └── user │ │ │ └── Login.vue │ ├── vue.config.js │ ├── web_server.py │ ├── webstorm.config.js │ └── yarn.lock ├── metadata │ ├── __init__.py │ ├── base.py │ ├── message.py │ ├── metadata_manager.py │ ├── namespace.py │ ├── state.py │ ├── task_execution.py │ ├── timer.py │ ├── util.py │ ├── workflow.py │ ├── workflow_event_trigger.py │ ├── workflow_execution.py │ ├── workflow_schedule.py │ └── workflow_snapshot.py ├── migrations │ ├── __init__.py │ ├── env.py │ ├── script.py.mako │ └── versions │ │ ├── 04d531f52690_add_metadata_tables.py │ │ ├── 7edd3c063e94_add_timer_table.py │ │ ├── __init__.py │ │ └── c7efdd9a9cad_add_message_table.py ├── model │ ├── __init__.py │ ├── action.py │ ├── condition.py │ ├── context.py │ ├── execution_type.py │ ├── internal │ │ ├── __init__.py │ │ ├── conditions.py │ │ ├── contexts.py │ │ └── events.py │ ├── operator.py │ ├── rule.py │ ├── state.py │ ├── status.py │ ├── task_execution.py │ ├── workflow.py │ └── workflow_execution.py ├── notification │ ├── __init__.py │ └── notification_client.py ├── operators │ ├── __init__.py │ ├── bash.py │ ├── flink │ │ ├── __init__.py │ │ └── flink_operator.py │ ├── python.py │ └── spark │ │ ├── __init__.py │ │ ├── spark_sql.py │ │ └── spark_submit.py ├── ops │ ├── __init__.py │ ├── namespace_ops.py │ ├── task_execution_ops.py │ ├── workflow_execution_ops.py │ ├── workflow_ops.py │ ├── workflow_schedule_ops.py │ ├── workflow_snapshot_ops.py │ └── workflow_trigger_ops.py ├── rpc │ ├── __init__.py │ ├── client │ │ ├── __init__.py │ │ ├── aiflow_client.py │ │ ├── heartbeat_client.py │ │ ├── scheduler_client.py │ │ └── util │ │ │ ├── __init__.py │ │ │ ├── proto_to_meta.py │ │ │ └── response_unwrapper.py │ ├── protobuf │ │ ├── __init__.py │ │ ├── go │ │ │ └── ai_flow │ │ │ │ ├── message.pb.go │ │ │ │ ├── scheduler_service.pb.go │ │ │ │ └── scheduler_service.pb.gw.go │ │ ├── heartbeat_service_pb2.py │ │ ├── heartbeat_service_pb2_grpc.py │ │ ├── message_pb2.py │ │ ├── proto │ │ │ ├── heartbeat_service.proto │ │ │ ├── message.proto │ │ │ └── scheduler_service.proto │ │ ├── scheduler_service_pb2.py │ │ ├── scheduler_service_pb2_grpc.py │ │ └── scripts │ │ │ ├── README.md │ │ │ ├── add_license.sh │ │ │ ├── gen_protobuf.sh │ │ │ ├── install_grpc_gateway.sh │ │ │ └── protoc-gen-grpc-java │ ├── server │ │ ├── __init__.py │ │ ├── exceptions.py │ │ ├── server.py │ │ └── server_runner.py │ └── service │ │ ├── __init__.py │ │ ├── scheduler_service.py │ │ └── util │ │ ├── __init__.py │ │ ├── meta_to_proto.py │ │ └── response_wrapper.py ├── scheduler │ ├── __init__.py │ ├── dispatcher.py │ ├── rule_executor.py │ ├── rule_extractor.py │ ├── rule_wrapper.py │ ├── runtime_context.py │ ├── schedule_command.py │ ├── scheduler.py │ ├── scheduling_event_processor.py │ ├── scheduling_unit.py │ ├── timer.py │ ├── worker.py │ └── workflow_executor.py ├── settings.py ├── task_executor │ ├── __init__.py │ ├── common │ │ ├── __init__.py │ │ ├── heartbeat_manager.py │ │ └── task_executor_base.py │ ├── kubernetes │ │ ├── __init__.py │ │ ├── helpers.py │ │ ├── k8s_task_executor.py │ │ ├── kube_config.py │ │ ├── pod_generator.py │ │ └── pod_template_file_sample │ │ │ └── pod_template.yaml │ ├── local │ │ ├── __init__.py │ │ ├── local_task_executor.py │ │ └── worker.py │ └── task_executor.py └── version.py ├── bin ├── init-aiflow-env.sh ├── init-airflow-env.sh ├── init-airflow-with-celery-executor.sh ├── proxy.go ├── start-aiflow.sh ├── start-airflow.sh ├── start-all-aiflow-services.sh ├── start_aiflow_web.py ├── start_rest_endpoint.sh ├── stop-aiflow.sh ├── stop-airflow.sh ├── stop-all-aiflow-services.sh └── stop_rest_endpoint.sh ├── build_ai_flow_package.sh ├── build_docker_image.sh ├── chart ├── Chart.lock ├── Chart.yaml ├── INSTALL ├── LICENSE ├── NOTICE ├── README.md ├── dockerfiles │ ├── README.md │ ├── pgbouncer-exporter │ │ ├── Dockerfile │ │ └── build_and_push.sh │ ├── pgbouncer │ │ ├── Dockerfile │ │ └── build_and_push.sh │ └── statsd-exporter │ │ ├── Dockerfile │ │ ├── build_and_push.sh │ │ └── mappings.yml ├── files │ └── pod-template-file.kubernetes-helm-yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.yaml │ ├── aiflow_webserver │ │ ├── webserver-deployment.yaml │ │ ├── webserver-ingress.yaml │ │ ├── webserver-networkpolicy.yaml │ │ ├── webserver-service.yaml │ │ └── webserver-serviceaccount.yaml │ ├── check-values.yaml │ ├── cleanup │ │ ├── cleanup-cronjob.yaml │ │ └── cleanup-serviceaccount.yaml │ ├── configmaps │ │ ├── aiflow-configmaps.yaml │ │ ├── configmap.yaml │ │ ├── extra-configmaps.yaml │ │ ├── statsd-configmap.yaml │ │ └── webserver-configmap.yaml │ ├── dags-persistent-volume-claim.yaml │ ├── flower │ │ ├── flower-deployment.yaml │ │ ├── flower-ingress.yaml │ │ ├── flower-networkpolicy.yaml │ │ ├── flower-service.yaml │ │ └── flower-serviceaccount.yaml │ ├── jobs │ │ ├── create-user-job-serviceaccount.yaml │ │ ├── create-user-job.yaml │ │ ├── migrate-database-job-serviceaccount.yaml │ │ └── migrate-database-job.yaml │ ├── limitrange.yaml │ ├── logs-persistent-volume-claim.yaml │ ├── notification │ │ ├── notifiaction-svc.yaml │ │ └── notification-deployment.yaml │ ├── pgbouncer │ │ ├── pgbouncer-deployment.yaml │ │ ├── pgbouncer-networkpolicy.yaml │ │ ├── pgbouncer-poddisruptionbudget.yaml │ │ ├── pgbouncer-service.yaml │ │ └── pgbouncer-serviceaccount.yaml │ ├── rbac │ │ ├── pod-cleanup-role.yaml │ │ ├── pod-cleanup-rolebinding.yaml │ │ ├── pod-launcher-role.yaml │ │ ├── pod-launcher-rolebinding.yaml │ │ ├── pod-log-reader-role.yaml │ │ └── pod-log-reader-rolebinding.yaml │ ├── redis │ │ ├── redis-networkpolicy.yaml │ │ ├── redis-service.yaml │ │ ├── redis-serviceaccount.yaml │ │ └── redis-statefulset.yaml │ ├── resourcequota.yaml │ ├── scheduler │ │ ├── scheduler-deployment.yaml │ │ ├── scheduler-networkpolicy.yaml │ │ ├── scheduler-poddisruptionbudget.yaml │ │ ├── scheduler-service.yaml │ │ └── scheduler-serviceaccount.yaml │ ├── secrets │ │ ├── elasticsearch-secret.yaml │ │ ├── extra-secrets.yaml │ │ ├── fernetkey-secret.yaml │ │ ├── flower-secret.yaml │ │ ├── metadata-connection-secret.yaml │ │ ├── pgbouncer-certificates-secret.yaml │ │ ├── pgbouncer-config-secret.yaml │ │ ├── pgbouncer-stats-secret.yaml │ │ ├── redis-secrets.yaml │ │ ├── registry-secret.yaml │ │ ├── result-backend-connection-secret.yaml │ │ └── webserver-secret-key-secret.yaml │ ├── statsd │ │ ├── statsd-deployment.yaml │ │ ├── statsd-networkpolicy.yaml │ │ ├── statsd-service.yaml │ │ └── statsd-serviceaccount.yaml │ ├── webserver │ │ ├── webserver-deployment.yaml │ │ ├── webserver-ingress.yaml │ │ ├── webserver-networkpolicy.yaml │ │ ├── webserver-service.yaml │ │ └── webserver-serviceaccount.yaml │ └── workers │ │ ├── worker-deployment.yaml │ │ ├── worker-kedaautoscaler.yaml │ │ ├── worker-networkpolicy.yaml │ │ ├── worker-service.yaml │ │ └── worker-serviceaccount.yaml ├── values.schema.json ├── values.yaml └── values_schema.schema.json ├── docker-compose.yaml ├── docs ├── Makefile ├── README.md ├── conf.py ├── content │ ├── architecture │ │ ├── aiflow_server.md │ │ ├── index.md │ │ ├── notification_server.md │ │ ├── overview.md │ │ ├── scheduler.md │ │ └── sdk.md │ ├── concepts │ │ ├── conditions.md │ │ ├── events.md │ │ ├── index.md │ │ ├── namespaces.md │ │ ├── operators.md │ │ ├── task_rules.md │ │ ├── tasks.md │ │ ├── workflow_executions.md │ │ ├── workflow_schedules.md │ │ ├── workflow_triggers.md │ │ └── workflows.md │ ├── get_started │ │ ├── about.md │ │ ├── index.md │ │ └── quickstart │ │ │ ├── in_docker.md │ │ │ ├── index.md │ │ │ ├── locally.md │ │ │ └── troubleshooting.md │ ├── how_to_guides │ │ ├── index.md │ │ └── set_up_mysql_as_backend.md │ ├── images │ │ ├── AIFlow-Deploy-Overview.png │ │ ├── ai_flow_webui.jpg │ │ ├── airflow_login_ui.png │ │ ├── architecture │ │ │ ├── ai_graph.png │ │ │ ├── architecture.png │ │ │ ├── meta.png │ │ │ ├── notification.png │ │ │ ├── principle.png │ │ │ ├── scheduler.png │ │ │ ├── scheduling_service.png │ │ │ ├── translator.png │ │ │ └── workflow.png │ │ ├── dingtalk_qr_code.png │ │ ├── functions.png │ │ ├── machine_learning_workflow.png │ │ ├── simple_workflow_graph.jpg │ │ ├── simple_workflow_metadata.jpg │ │ ├── sklearn_batch_train_stream_predict_execution.png │ │ ├── sklearn_batch_train_stream_predict_graph.png │ │ ├── sklearn_batch_train_stream_predict_meta.png │ │ └── tutorial │ │ │ ├── channels.png │ │ │ └── success_workflow.png │ ├── installation │ │ ├── index.md │ │ ├── installing_from_pypi.md │ │ └── installing_from_sources.md │ ├── operation │ │ ├── client_configuration.md │ │ ├── deploying_aiflow_server.md │ │ ├── deploying_notification_server.md │ │ ├── high_availability.md │ │ └── index.md │ ├── plugins │ │ ├── blob_manager_plugin.md │ │ └── index.md │ └── tutorial_and_examples │ │ ├── examples.md │ │ ├── index.md │ │ └── tutorial.md ├── docgen.sh ├── index.rst ├── reference │ ├── api │ │ ├── index.rst │ │ ├── java │ │ │ ├── aiflow.md │ │ │ ├── index.md │ │ │ └── notification.md │ │ └── python │ │ │ └── index.rst │ ├── cli │ │ ├── aiflow.md │ │ ├── index.md │ │ └── notification.md │ └── extra_packages.md └── requirements.txt ├── install_aiflow.sh ├── lib └── notification_service │ ├── MANIFEST.in │ ├── README.md │ ├── bin │ ├── init-notification-env.sh │ ├── proxy.go │ ├── start-notification.sh │ ├── start_notification_server.py │ └── stop-notification.sh │ ├── java │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── aiflow │ │ │ └── notification │ │ │ ├── client │ │ │ ├── EmbeddedNotificationClient.java │ │ │ ├── EventListener.java │ │ │ ├── ListenerProcessor.java │ │ │ ├── ListenerRegistrationId.java │ │ │ ├── NotificationClient.java │ │ │ └── NotificationInterceptor.java │ │ │ ├── conf │ │ │ └── Configuration.java │ │ │ ├── entity │ │ │ ├── EventMeta.java │ │ │ └── SenderEventCount.java │ │ │ └── proto │ │ │ ├── NotificationServiceGrpc.java │ │ │ └── NotificationServiceOuterClass.java │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── aiflow │ │ │ └── notification │ │ │ ├── client │ │ │ └── EmbeddedNotificationClientTest.java │ │ │ ├── conf │ │ │ └── TestConfiguration.java │ │ │ └── service │ │ │ └── PythonServer.java │ │ └── resources │ │ ├── log4j2-test.properties │ │ └── notification_server.py │ ├── notification_service │ ├── __init__.py │ ├── __main__.py │ ├── alembic.ini │ ├── cli │ │ ├── __init__.py │ │ ├── cli_parser.py │ │ ├── commands │ │ │ ├── __init__.py │ │ │ ├── config_command.py │ │ │ ├── db_command.py │ │ │ ├── event_command.py │ │ │ ├── server_command.py │ │ │ └── version_command.py │ │ └── simple_table.py │ ├── client │ │ ├── __init__.py │ │ ├── embedded_notification_client.py │ │ └── notification_client.py │ ├── config_templates │ │ ├── __init__.py │ │ └── default_notification_server.yaml │ ├── migrations │ │ ├── __init__.py │ │ ├── env.py │ │ ├── script.py.mako │ │ └── versions │ │ │ ├── 29623a4151ed_add_member.py │ │ │ ├── 87cb292bcc31_add_tables.py │ │ │ └── __init__.py │ ├── model │ │ ├── __init__.py │ │ ├── event.py │ │ ├── member.py │ │ └── sender_event_count.py │ ├── rpc │ │ ├── __init__.py │ │ ├── protobuf │ │ │ ├── __init__.py │ │ │ ├── go │ │ │ │ └── notification_service │ │ │ │ │ ├── notification_service.pb.go │ │ │ │ │ └── notification_service.pb.gw.go │ │ │ ├── notification_service_pb2.py │ │ │ ├── notification_service_pb2_grpc.py │ │ │ ├── proto │ │ │ │ └── notification_service.proto │ │ │ └── scripts │ │ │ │ ├── add_license.sh │ │ │ │ ├── gen_protobuf.sh │ │ │ │ └── protoc-gen-grpc-java │ │ └── service.py │ ├── server │ │ ├── __init__.py │ │ ├── ha_manager.py │ │ ├── server.py │ │ └── server_runner.py │ ├── settings.py │ ├── storage │ │ ├── __init__.py │ │ ├── alchemy │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── db_client_storage.py │ │ │ ├── db_event_storage.py │ │ │ └── db_high_availability_storage.py │ │ ├── event_storage.py │ │ ├── high_availability.py │ │ ├── in_memory │ │ │ ├── __init__.py │ │ │ └── memory_event_storage.py │ │ └── mongo │ │ │ ├── __init__.py │ │ │ └── mongo_event_storage.py │ ├── util │ │ ├── __init__.py │ │ ├── cli.py │ │ ├── db.py │ │ ├── server_config.py │ │ └── utils.py │ └── version.py │ ├── requirements.txt │ ├── setup.py │ └── tests │ ├── __init__.py │ ├── cli │ ├── __init__.py │ ├── commands │ │ ├── __init__.py │ │ ├── test_config_command.py │ │ ├── test_db_command.py │ │ ├── test_event_command.py │ │ ├── test_server_command.py │ │ └── test_version_command.py │ └── test_cli.py │ ├── client │ ├── __init__.py │ └── test_embedded_notification_client.py │ ├── notification_service_itest.py │ ├── server │ ├── __init__.py │ ├── test_high_availability.py │ └── test_notification_server.py │ ├── test_settings.py │ └── util │ ├── __init__.py │ ├── notification_server.yaml │ ├── test_db.py │ ├── test_server_config.py │ └── test_util.py ├── licenses ├── LICENSE-ace.txt ├── LICENSE-apache-airflow.txt ├── LICENSE-apache-flink.txt ├── LICENSE-bootstrap-toggle.txt ├── LICENSE-bootstrap.txt ├── LICENSE-bootstrap3-typeahead.txt ├── LICENSE-d3-tip.txt ├── LICENSE-d3js.txt ├── LICENSE-dagre-d3.txt ├── LICENSE-datatables.txt ├── LICENSE-elasticmock.txt ├── LICENSE-eonasdan-bootstrap-datetimepicker.txt ├── LICENSE-flask-kerberos.txt ├── LICENSE-hue.txt ├── LICENSE-jqclock.txt ├── LICENSE-jquery.txt ├── LICENSE-moment-strftime.txt ├── LICENSE-moment.txt ├── LICENSE-normalize.txt ├── LICENSE-parallel-coordinates.txt ├── LICENSE-python-nvd3.txt ├── LICENSE-python-slugify.txt ├── LICENSE-scikit-learn.txt ├── LICENSE-tensorlfow.txt ├── LICENSE-underscorejs.txt └── LICENSE-webgl-2d.txt ├── pom.xml ├── requirements-dev.txt ├── requirements.txt ├── run_tests.sh ├── samples ├── __init__.py ├── custom_condition │ └── custom_condition_example.py ├── event_trigger_workflow │ └── event_trigger_workflow.py ├── flink_operator │ └── flink_run_example.py ├── online_machine_learning │ ├── dataset │ │ ├── mnist_evaluate.npz │ │ ├── mnist_predict.npz │ │ └── mnist_train.npz │ └── online_ml_workflow.py ├── periodic │ ├── periodic_task.py │ └── periodic_workflow.py ├── quickstart │ └── quickstart_workflow.py └── spark_operator │ └── spark_submit_example.py ├── setup.py └── tests ├── __init__.py ├── blob_manager ├── __init__.py ├── impl │ ├── __init__.py │ ├── test_hdfs_blob_manager.py │ ├── test_local_blob_manager.py │ ├── test_oss_blob_manager.py │ └── test_s3_blob_manager.py └── test_blob_manager_interface.py ├── common ├── __init__.py ├── configuration │ ├── __init__.py │ └── test_configuration.py └── util │ ├── __init__.py │ ├── db_util │ ├── __init__.py │ ├── test_db_migration.py │ └── test_session.py │ ├── for_test_workflow_utils │ ├── artifact │ │ └── artifact.py │ └── workflow.py │ ├── test_local_registry.py │ ├── test_module_utils.py │ ├── test_string_utils.py │ ├── test_thread_utils.py │ ├── test_time_utils.py │ └── test_workflow_utils.py ├── metadata ├── __init__.py ├── test_message_queue.py └── test_metadata_manager.py ├── model ├── __init__.py ├── internal │ ├── __init__.py │ └── test_conditions.py ├── test_status.py └── test_workflow.py ├── notification ├── __init__.py └── test_notification_client.py ├── operators ├── __init__.py ├── flink │ ├── __init__.py │ └── test_flink_operator.py ├── spark │ ├── __init__.py │ ├── test_spark_sql.py │ └── test_spark_submit.py ├── test_bash_operator.py └── test_python_operator.py ├── ops ├── __init__.py ├── test_workflow_ops.py └── workflow_for_unittest.py ├── rpc ├── __init__.py ├── test_namespace_rpc.py ├── test_task_execution_rpc.py ├── test_workflow_execution_rpc.py ├── test_workflow_rpc.py ├── test_workflow_schedule_rpc.py ├── test_workflow_snapshot_rpc.py └── test_workflow_trigger_rpc.py ├── scheduler ├── __init__.py ├── test_dispatcher.py ├── test_rule_executor.py ├── test_rule_extractor.py ├── test_scheduler.py ├── test_scheduling_event_processor.py ├── test_timer.py ├── test_utils.py ├── test_worker.py └── test_workflow_executor.py ├── task_executor ├── __init__.py ├── common │ ├── __init__.py │ ├── test_heartbeat_manager.py │ └── test_task_executor_base.py ├── kubernetes │ ├── __init__.py │ ├── base_pod.yaml │ ├── pod_for_deserialize.yaml │ ├── test_helpers.py │ ├── test_k8s_task_executor.py │ ├── test_kube_config.py │ └── test_pod_generator.py ├── local │ ├── __init__.py │ └── test_local_task_executor.py └── test_task_executor.py └── test_utils ├── __init__.py ├── mock_utils.py └── unittest_base.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | 3 | branch = True 4 | 5 | concurrency = 6 | thread 7 | multiprocessing 8 | 9 | source = 10 | ai_flow 11 | lib/notification_service 12 | 13 | omit = 14 | ai_flow/test/* 15 | ai_flow/protobuf/* 16 | lib/notification_service/tests/* 17 | lib/notification_service/notification_service/proto/* 18 | 19 | parallel = True -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new_feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New Feature 3 | about: Requires a new feature 4 | 5 | --- 6 | 7 | 12 | 13 | ### Describe the feature 14 | 15 | 16 | ### Describe the solution you'd like 17 | 18 | 19 | ### Describe alternatives you've considered 20 | 21 | 22 | ### Additional context 23 | 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/report_bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report problems and unexpected behavior 4 | 5 | --- 6 | 7 | 12 | 13 | ### Describe the bug 14 | 15 | 16 | ### Your environment 17 | #### Operating system 18 | 19 | 20 | #### Database 21 | 22 | 23 | #### Python version 24 | 25 | 26 | ### To Reproduce 27 | Steps to reproduce the behavior (if you can): 28 | 1. Submit a '...' 29 | 2. Click on '....' 30 | 3. See error 31 | 32 | ### Expected behavior 33 | 34 | 35 | ### Actual behavior 36 | 37 | 38 | ### Screenshots 39 | 40 | 41 | ### Additional context 42 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## What is the purpose of the change 8 | 9 | *(For example: This pull request makes user can stop workflow externally.)* 10 | 11 | 12 | ## Brief change log 13 | 14 | *(for example:)* 15 | - *Send StopDagEvent to Airflow scheduler via notification service* 16 | - *Once received StopDagEvent, Airflow scheduler kills all running dag runs* 17 | 18 | 19 | ## Verifying this change 20 | 21 | *(Please pick either of the following options)* 22 | 23 | This change is a trivial rework / code cleanup without any test coverage. 24 | 25 | *(or)* 26 | 27 | This change is already covered by existing tests, such as *(please describe tests)*. 28 | 29 | *(or)* 30 | 31 | This change added tests. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | .settings 4 | .factorypath 5 | target 6 | *.log 7 | dependency-reduced-pom.xml 8 | .DS_Store 9 | .ipynb_checkpoints 10 | node_modules 11 | 12 | *.py[cod] 13 | __pycache__ 14 | .pytest_cache 15 | *.swp 16 | .vscode/ 17 | cmake_build/ 18 | .idea/** 19 | /deep-learning-on-flink/build/ 20 | [Bb]uild/ 21 | Pods 22 | Podfile.lock 23 | *.pbxproj 24 | *.xcworkspacedata 25 | xcuserdata/** 26 | tfOnFlink/python/var 27 | deep-learning-on-flink/**/bin 28 | #**/*.so 29 | **/*.dylib 30 | **/*.egg-info 31 | **/temp 32 | 33 | # Android 34 | .gradle 35 | .idea 36 | *.iml 37 | local.properties 38 | gradleBuild 39 | 40 | ai_flow.egg-info/* 41 | ai_flow/test/endpoint/aiflow.db 42 | ai_flow/test/api/workflow_config.json 43 | ai_flow/test/common/test.yaml 44 | examples/**/generated/* 45 | venv/* 46 | dist/* 47 | lib/notification_service/dist/* 48 | 49 | **/logs/ 50 | **/saved_model/ 51 | **/pushed_model/ 52 | 53 | # docs generated 54 | docs/_build 55 | docs/reference/api/python/source_rst 56 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | version: 2 16 | formats: all 17 | sphinx: 18 | configuration: docs/conf.py 19 | fail_on_warning: false 20 | 21 | build: 22 | image: latest 23 | apt_packages: 24 | - default-libmysqlclient-dev 25 | - build-essential 26 | 27 | submodules: 28 | exclude: all 29 | 30 | python: 31 | # For available versions, see: 32 | # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-image 33 | version: 3.7 # AIFlow currently only support py3.7 34 | install: 35 | - method: pip 36 | path: lib/notification_service 37 | - method: pip 38 | path: . 39 | - requirements: docs/requirements.txt 40 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | include requirements.txt 18 | graft bin/ 19 | global-exclude __pycache__ *.pyc 20 | graft ai_flow/common/configuration/config_templates 21 | prune ai_flow/frontend 22 | graft ai_flow/frontend/dist 23 | include ai_flow/frontend/__init__.py 24 | include ai_flow/frontend/web_server.py 25 | -------------------------------------------------------------------------------- /ai_flow/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | import ai_flow.settings 18 | -------------------------------------------------------------------------------- /ai_flow/__main__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | """Main executable module""" 18 | import argcomplete 19 | from ai_flow.cli import cli_parser 20 | 21 | 22 | def main(): 23 | """Main executable function""" 24 | 25 | parser = cli_parser.get_parser() 26 | argcomplete.autocomplete(parser) 27 | args = parser.parse_args() 28 | args.func(args) 29 | 30 | 31 | if __name__ == '__main__': 32 | main() 33 | -------------------------------------------------------------------------------- /ai_flow/blob_manager/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/blob_manager/impl/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/cli/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/cli/commands/version_command.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | """Version command""" 18 | from ai_flow.version import __version__ 19 | 20 | 21 | def version(args): 22 | """Displays AIFlow version at the command line""" 23 | print(__version__) 24 | -------------------------------------------------------------------------------- /ai_flow/common/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/common/configuration/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/common/configuration/config_templates/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/common/configuration/config_templates/aiflow_client.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | # address of AIFlow server 17 | server_address: localhost:50051 18 | 19 | # configurations about blob manager 20 | blob_manager: 21 | blob_manager_class: ai_flow.blob_manager.impl.local_blob_manager.LocalBlobManager 22 | blob_manager_config: 23 | root_directory: {AIFLOW_HOME}/blob -------------------------------------------------------------------------------- /ai_flow/common/exception/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/common/util/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/common/util/db_util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/common/util/db_util/orm_event_handlers.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from sqlalchemy import event 16 | 17 | 18 | def setup_event_handlers(engine): 19 | """Setups event handlers.""" 20 | 21 | if engine.dialect.name == "sqlite": 22 | 23 | @event.listens_for(engine, "connect") 24 | def set_sqlite_pragma(dbapi_connection, connection_record): 25 | cursor = dbapi_connection.cursor() 26 | cursor.execute("PRAGMA foreign_keys=ON") 27 | cursor.close() 28 | 29 | -------------------------------------------------------------------------------- /ai_flow/common/util/file_util/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/common/util/file_util/hash_util.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | import hashlib 18 | 19 | 20 | def generate_file_md5(file, chunk_size=2**20): 21 | file_hash = hashlib.md5() 22 | 23 | with open(file, "rb") as f: 24 | 25 | while True: 26 | chunk = f.read(chunk_size) 27 | if not chunk: 28 | break 29 | file_hash.update(chunk) 30 | return file_hash.hexdigest() 31 | -------------------------------------------------------------------------------- /ai_flow/common/util/log_util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/common/util/net_utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | 18 | import socket 19 | 20 | 21 | def get_ip_addr(): 22 | """ 23 | Get ip address of localhost by UDP socket. 24 | :return: ip address of localhost 25 | """ 26 | try: 27 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 28 | s.connect(('8.8.8.8', 80)) 29 | ip = s.getsockname()[0] 30 | except OSError: 31 | ip = '127.0.0.1' 32 | finally: 33 | s.close() 34 | return ip 35 | -------------------------------------------------------------------------------- /ai_flow/frontend/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 10 4 | -------------------------------------------------------------------------------- /ai_flow/frontend/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset=utf-8 3 | end_of_line=lf 4 | insert_final_newline=false 5 | indent_style=space 6 | indent_size=2 7 | 8 | [{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}] 9 | indent_style=space 10 | indent_size=2 11 | 12 | [{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] 13 | indent_style=space 14 | indent_size=2 15 | 16 | [{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}] 17 | indent_style=space 18 | indent_size=2 19 | 20 | [*.svg] 21 | indent_style=space 22 | indent_size=2 23 | 24 | [*.js.map] 25 | indent_style=space 26 | indent_size=2 27 | 28 | [*.less] 29 | indent_style=space 30 | indent_size=2 31 | 32 | [*.vue] 33 | indent_style=space 34 | indent_size=2 35 | 36 | [{.analysis_options,*.yml,*.yaml}] 37 | indent_style=space 38 | indent_size=2 39 | 40 | -------------------------------------------------------------------------------- /ai_flow/frontend/.env: -------------------------------------------------------------------------------- 1 | NODE_ENV=production 2 | VUE_APP_PREVIEW=false 3 | -------------------------------------------------------------------------------- /ai_flow/frontend/.env.development: -------------------------------------------------------------------------------- 1 | NODE_ENV=development 2 | VUE_APP_PREVIEW=true 3 | -------------------------------------------------------------------------------- /ai_flow/frontend/.env.preview: -------------------------------------------------------------------------------- 1 | NODE_ENV=production 2 | VUE_APP_PREVIEW=true 3 | -------------------------------------------------------------------------------- /ai_flow/frontend/.gitattributes: -------------------------------------------------------------------------------- 1 | public/* linguist-vendored -------------------------------------------------------------------------------- /ai_flow/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | package-lock.json 23 | -------------------------------------------------------------------------------- /ai_flow/frontend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "semi": false, 4 | "singleQuote": true, 5 | "prettier.spaceBeforeFunctionParen": true 6 | } 7 | -------------------------------------------------------------------------------- /ai_flow/frontend/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 10.15.0 4 | cache: yarn 5 | script: 6 | - yarn 7 | - yarn run lint --no-fix && yarn run build 8 | -------------------------------------------------------------------------------- /ai_flow/frontend/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Anan Yang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /ai_flow/frontend/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/frontend/compile_frontend.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | 17 | set -e 18 | 19 | cd "$( dirname "${BASH_SOURCE[0]}" )" 20 | 21 | # first bump up package.json manually, commit and tag 22 | if [[ -d ./dist ]]; then 23 | rm -rf ./dist 24 | fi 25 | 26 | yarn install 27 | yarn run build 28 | -------------------------------------------------------------------------------- /ai_flow/frontend/jest.config.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | module.exports = { 19 | moduleFileExtensions: [ 20 | 'js', 21 | 'jsx', 22 | 'json', 23 | 'vue' 24 | ], 25 | transform: { 26 | '^.+\\.vue$': 'vue-jest', 27 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', 28 | '^.+\\.jsx?$': 'babel-jest' 29 | }, 30 | moduleNameMapper: { 31 | '^@/(.*)$': '/src/$1' 32 | }, 33 | snapshotSerializers: [ 34 | 'jest-serializer-vue' 35 | ], 36 | testMatch: [ 37 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 38 | ], 39 | testURL: 'http://localhost/' 40 | } 41 | -------------------------------------------------------------------------------- /ai_flow/frontend/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["src/*"] 7 | } 8 | }, 9 | "exclude": ["node_modules", "dist"], 10 | "include": ["src/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /ai_flow/frontend/postcss.config.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | module.exports = { 19 | plugins: { 20 | autoprefixer: {} 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ai_flow/frontend/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/ai_flow/frontend/public/logo.png -------------------------------------------------------------------------------- /ai_flow/frontend/src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 21 | 22 | 41 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/AvatarList/Item.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'ant-design-vue/es/_util/vue-types' 2 | import { Tooltip, Avatar } from 'ant-design-vue' 3 | import { getSlotOptions } from 'ant-design-vue/lib/_util/props-util' 4 | import { warning } from 'ant-design-vue/lib/vc-util/warning' 5 | 6 | export const AvatarListItemProps = { 7 | tips: PropTypes.string, 8 | src: PropTypes.string.def('') 9 | } 10 | 11 | const Item = { 12 | __ANT_AVATAR_CHILDREN: true, 13 | name: 'AvatarListItem', 14 | props: AvatarListItemProps, 15 | created () { 16 | warning(getSlotOptions(this.$parent).__ANT_AVATAR_LIST, 'AvatarListItem must be a subcomponent of AvatarList') 17 | }, 18 | render () { 19 | const size = this.$parent.size === 'mini' ? 'small' : this.$parent.size 20 | const AvatarDom = 21 | return (this.tips && {AvatarDom}) || 22 | } 23 | } 24 | 25 | export default Item 26 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/AvatarList/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import AvatarList from './List' 19 | import Item from './Item' 20 | 21 | export { 22 | AvatarList, 23 | Item as AvatarListItem 24 | } 25 | 26 | export default AvatarList 27 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/AvatarList/index.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @avatar-list-prefix-cls: ~"@{ant-pro-prefix}-avatar-list"; 4 | @avatar-list-item-prefix-cls: ~"@{ant-pro-prefix}-avatar-list-item"; 5 | 6 | .@{avatar-list-prefix-cls} { 7 | display: inline-block; 8 | 9 | ul { 10 | list-style: none; 11 | display: inline-block; 12 | padding: 0; 13 | margin: 0 0 0 8px; 14 | font-size: 0; 15 | } 16 | } 17 | 18 | .@{avatar-list-item-prefix-cls} { 19 | display: inline-block; 20 | font-size: @font-size-base; 21 | margin-left: -8px; 22 | width: @avatar-size-base; 23 | height: @avatar-size-base; 24 | 25 | :global { 26 | .ant-avatar { 27 | border: 1px solid #fff; 28 | cursor: pointer; 29 | } 30 | } 31 | 32 | &.large { 33 | width: @avatar-size-lg; 34 | height: @avatar-size-lg; 35 | } 36 | 37 | &.small { 38 | width: @avatar-size-sm; 39 | height: @avatar-size-sm; 40 | } 41 | 42 | &.mini { 43 | width: 20px; 44 | height: 20px; 45 | 46 | :global { 47 | .ant-avatar { 48 | width: 20px; 49 | height: 20px; 50 | line-height: 20px; 51 | 52 | .ant-avatar-string { 53 | font-size: 12px; 54 | line-height: 18px; 55 | } 56 | } 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/Ellipsis/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import Ellipsis from './Ellipsis' 19 | 20 | export default Ellipsis 21 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/FooterToolbar/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import FooterToolBar from './FooterToolBar' 19 | import './index.less' 20 | 21 | export default FooterToolBar 22 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/FooterToolbar/index.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @footer-toolbar-prefix-cls: ~"@{ant-pro-prefix}-footer-toolbar"; 4 | 5 | .@{footer-toolbar-prefix-cls} { 6 | position: fixed; 7 | width: 100%; 8 | bottom: 0; 9 | right: 0; 10 | height: 56px; 11 | line-height: 56px; 12 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03); 13 | background: #fff; 14 | border-top: 1px solid #e8e8e8; 15 | padding: 0 24px; 16 | z-index: 9; 17 | 18 | &:after { 19 | content: ""; 20 | display: block; 21 | clear: both; 22 | } 23 | } -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/Graph/color.styl: -------------------------------------------------------------------------------- 1 | $colorBlue = #20A0FF 2 | $colorLightBlue = #58B7FF 3 | $colorDarkBlue = #1D8CE0 4 | $colorGreen = #13CE66 5 | $colorYellow = #F7BA2A 6 | $colorRed = #F56C6C 7 | $colorDark = #111111 8 | $colorLessDark = #222222 9 | $colorExtraLessDark = #333333 10 | $colorBlack = #1F2D3D 11 | $colorLightBlack = #324057 12 | $colorExtraLightBlack = #475669 13 | $colorSilver = #8492A6 14 | $colorLightSilver = #99A9BF 15 | $colorExtraLightSilver = #C0CCDA 16 | $colorGray = #D3DCE6 17 | $colorLightGray = #E5E9F2 18 | $colorExtraLightGray = #EFF2F7 19 | $colorDarkWhite = #F9FAFC 20 | $colorWhite = #FFFFFF 21 | $colorDashboardDark = #111d31 22 | $colorDefaultBlack = #303133 23 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/IconSelector/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import IconSelector from './IconSelector' 19 | export default IconSelector 20 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/MultiTab/events.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import Vue from 'vue' 19 | export default new Vue() 20 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/MultiTab/index.less: -------------------------------------------------------------------------------- 1 | @import '../index'; 2 | 3 | @multi-tab-prefix-cls: ~"@{ant-pro-prefix}-multi-tab"; 4 | @multi-tab-wrapper-prefix-cls: ~"@{ant-pro-prefix}-multi-tab-wrapper"; 5 | 6 | /* 7 | .topmenu .@{multi-tab-prefix-cls} { 8 | max-width: 1200px; 9 | margin: -23px auto 24px auto; 10 | } 11 | */ 12 | .@{multi-tab-prefix-cls} { 13 | margin: -23px -24px 24px -24px; 14 | background: #fff; 15 | } 16 | 17 | .topmenu .@{multi-tab-wrapper-prefix-cls} { 18 | max-width: 1200px; 19 | margin: 0 auto; 20 | } 21 | 22 | .topmenu.content-width-Fluid .@{multi-tab-wrapper-prefix-cls} { 23 | max-width: 100%; 24 | margin: 0 auto; 25 | } 26 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/NoticeIcon/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import NoticeIcon from './NoticeIcon' 19 | export default NoticeIcon 20 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/Search/index.less: -------------------------------------------------------------------------------- 1 | @import "~ant-design-vue/es/style/themes/default"; 2 | 3 | .global-search-wrapper { 4 | position: fixed; 5 | top: 0; 6 | left: 0; 7 | right: 0; 8 | bottom: 0; 9 | z-index: @zindex-modal-mask; 10 | background: @modal-mask-bg; 11 | 12 | .global-search-box { 13 | position: absolute; 14 | top: 20%; 15 | left: 50%; 16 | width: 450px; 17 | transform: translate(-50%, -50%); 18 | 19 | .global-search-tips { 20 | color: @white; 21 | font-size: @font-size-lg; 22 | text-align: right; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/SelectLang/index.less: -------------------------------------------------------------------------------- 1 | @import "~ant-design-vue/es/style/themes/default"; 2 | 3 | @header-menu-prefix-cls: ~'@{ant-prefix}-pro-header-menu'; 4 | @header-drop-down-prefix-cls: ~'@{ant-prefix}-pro-drop-down'; 5 | 6 | .@{header-menu-prefix-cls} { 7 | 8 | .anticon { 9 | margin-right: 8px; 10 | } 11 | .ant-dropdown-menu-item { 12 | min-width: 160px; 13 | } 14 | } 15 | 16 | .@{header-drop-down-prefix-cls} { 17 | 18 | line-height: @layout-header-height; 19 | vertical-align: top; 20 | cursor: pointer; 21 | 22 | > i { 23 | font-size: 16px !important; 24 | transform: none !important; 25 | 26 | svg { 27 | position: relative; 28 | top: -1px; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/SettingDrawer/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import SettingDrawer from './SettingDrawer' 19 | export default SettingDrawer 20 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/StandardFormRow/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import StandardFormRow from './StandardFormRow' 19 | 20 | export default StandardFormRow 21 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | // pro components 19 | import AvatarList from '@/components/AvatarList' 20 | import Ellipsis from '@/components/Ellipsis' 21 | import FooterToolbar from '@/components/FooterToolbar' 22 | import STable from '@/components/Table' 23 | import MultiTab from '@/components/MultiTab' 24 | import IconSelector from '@/components/IconSelector' 25 | import StandardFormRow from '@/components/StandardFormRow' 26 | 27 | export { 28 | AvatarList, 29 | Ellipsis, 30 | FooterToolbar, 31 | STable, 32 | MultiTab, 33 | IconSelector, 34 | StandardFormRow 35 | } 36 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/components/index.less: -------------------------------------------------------------------------------- 1 | @import "~ant-design-vue/lib/style/index"; 2 | 3 | // The prefix to use on all css classes from ant-pro. 4 | @ant-pro-prefix : ant-pro; 5 | @ant-global-sider-zindex : 106; 6 | @ant-global-header-zindex : 105; -------------------------------------------------------------------------------- /ai_flow/frontend/src/core/icons.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import bxAnaalyse from '@/assets/icons/bx-analyse.svg?inline' // path to your '*.svg?inline' file. 19 | 20 | export { bxAnaalyse } 21 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/layouts/BasicLayout.less: -------------------------------------------------------------------------------- 1 | @import "~ant-design-vue/es/style/themes/default.less"; 2 | 3 | .ant-pro-global-header-index-right { 4 | margin-right: 8px; 5 | 6 | &.ant-pro-global-header-index-dark { 7 | .ant-pro-global-header-index-action { 8 | color: hsla(0, 0%, 100%, .85); 9 | 10 | &:hover { 11 | background: #1890ff; 12 | } 13 | } 14 | } 15 | 16 | .ant-pro-account-avatar { 17 | .antd-pro-global-header-index-avatar { 18 | margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0; 19 | margin-right: 8px; 20 | color: @primary-color; 21 | vertical-align: top; 22 | background: rgba(255, 255, 255, 0.85); 23 | } 24 | } 25 | 26 | .menu { 27 | .anticon { 28 | margin-right: 8px; 29 | } 30 | 31 | .ant-dropdown-menu-item { 32 | min-width: 100px; 33 | } 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/layouts/BlankLayout.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 26 | 27 | 30 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/layouts/PageView.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/layouts/RouteView.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 43 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/layouts/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import UserLayout from './UserLayout' 19 | import BlankLayout from './BlankLayout' 20 | import BasicLayout from './BasicLayout' 21 | import RouteView from './RouteView' 22 | import PageView from './PageView' 23 | 24 | export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView } 25 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/locales/lang/en-US/user.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | export default { 19 | 'user.login.userName': 'userName', 20 | 'user.login.password': 'password', 21 | 'user.login.username.placeholder': 'Account: admin', 22 | 'user.login.password.placeholder': 'password: admin or ant.design', 23 | 'user.login.message-invalid-credentials': 24 | 'Invalid username or password(admin/admin)', 25 | 'user.login.tab-login-credentials': 'Credentials', 26 | 'user.login.remember-me': 'Remember me', 27 | 'user.login.login': 'Login' 28 | } 29 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/mock/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import { isIE } from '@/utils/util' 19 | 20 | if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_PREVIEW === 'true') { 21 | if (isIE()) { 22 | console.error('[AIFlow] ERROR: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.') 23 | } 24 | console.log('[AIFlow] mock mounting') 25 | const Mock = require('mockjs2') 26 | require('./services/auth') 27 | require('./services/user') 28 | 29 | Mock.setup({ 30 | timeout: 800 31 | }) 32 | console.log('[AIFlow] mock mounted') 33 | } 34 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/router/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import Vue from 'vue' 19 | import Router from 'vue-router' 20 | import { constantRouterMap } from '@/config/router.config' 21 | 22 | // hack router push callback 23 | const originalPush = Router.prototype.push 24 | Router.prototype.push = function push (location, onResolve, onReject) { 25 | if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) 26 | return originalPush.call(this, location).catch(err => err) 27 | } 28 | 29 | Vue.use(Router) 30 | 31 | export default new Router({ 32 | mode: 'history', 33 | routes: constantRouterMap 34 | }) 35 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/store/device-mixin.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import { mapState } from 'vuex' 19 | 20 | const deviceMixin = { 21 | computed: { 22 | ...mapState({ 23 | isMobile: state => state.app.isMobile 24 | }) 25 | } 26 | } 27 | 28 | export { deviceMixin } 29 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/store/getters.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | const getters = { 19 | isMobile: state => state.app.isMobile, 20 | lang: state => state.app.lang, 21 | theme: state => state.app.theme, 22 | color: state => state.app.color, 23 | token: state => state.user.token, 24 | avatar: state => state.user.avatar, 25 | nickname: state => state.user.name, 26 | welcome: state => state.user.welcome, 27 | roles: state => state.user.roles, 28 | userInfo: state => state.user.info, 29 | addRouters: state => state.permission.addRouters, 30 | multiTab: state => state.app.multiTab 31 | } 32 | 33 | export default getters 34 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/store/i18n-mixin.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import { mapState } from 'vuex' 19 | 20 | const i18nMixin = { 21 | computed: { 22 | ...mapState({ 23 | currentLang: state => state.app.lang 24 | }) 25 | }, 26 | methods: { 27 | setLang (lang) { 28 | this.$store.dispatch('setLang', lang) 29 | } 30 | } 31 | } 32 | 33 | export default i18nMixin 34 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/store/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import Vue from 'vue' 19 | import Vuex from 'vuex' 20 | 21 | import app from './modules/app' 22 | import user from './modules/user' 23 | 24 | // default router permission control 25 | // import permission from './modules/permission' 26 | 27 | // dynamic router permission control (Experimental) 28 | import permission from './modules/async-router' 29 | import getters from './getters' 30 | 31 | Vue.use(Vuex) 32 | 33 | export default new Vuex.Store({ 34 | modules: { 35 | app, 36 | user, 37 | permission 38 | }, 39 | state: {}, 40 | mutations: {}, 41 | actions: {}, 42 | getters 43 | }) 44 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/utils/filter.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | import Vue from 'vue' 19 | import moment from 'moment' 20 | import 'moment/locale/zh-cn' 21 | moment.locale('zh-cn') 22 | 23 | Vue.filter('NumberFormat', function (value) { 24 | if (!value) { 25 | return '0' 26 | } 27 | const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') 28 | return intPartFormat 29 | }) 30 | 31 | Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { 32 | return moment(dataStr).format(pattern) 33 | }) 34 | 35 | Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { 36 | return moment(dataStr).format(pattern) 37 | }) 38 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/utils/utils.less: -------------------------------------------------------------------------------- 1 | .textOverflow() { 2 | overflow: hidden; 3 | white-space: nowrap; 4 | text-overflow: ellipsis; 5 | word-break: break-all; 6 | } 7 | 8 | .textOverflowMulti(@line: 3, @bg: #fff) { 9 | position: relative; 10 | max-height: @line * 1.5em; 11 | margin-right: -1em; 12 | padding-right: 1em; 13 | overflow: hidden; 14 | line-height: 1.5em; 15 | text-align: justify; 16 | &::before { 17 | position: absolute; 18 | right: 14px; 19 | bottom: 0; 20 | padding: 0 1px; 21 | background: @bg; 22 | content: '...'; 23 | } 24 | &::after { 25 | position: absolute; 26 | right: 14px; 27 | width: 1em; 28 | height: 1em; 29 | margin-top: 0.2em; 30 | background: white; 31 | content: ''; 32 | } 33 | } 34 | 35 | // mixins for clearfix 36 | // ------------------------ 37 | .clearfix() { 38 | zoom: 1; 39 | &::before, 40 | &::after { 41 | display: table; 42 | content: ' '; 43 | } 44 | &::after { 45 | clear: both; 46 | height: 0; 47 | font-size: 0; 48 | visibility: hidden; 49 | } 50 | } -------------------------------------------------------------------------------- /ai_flow/frontend/src/views/404.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 25 | 26 | 29 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/views/exception/403.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | 24 | 34 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/views/exception/404.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | 24 | 34 | -------------------------------------------------------------------------------- /ai_flow/frontend/src/views/exception/500.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | 24 | 34 | -------------------------------------------------------------------------------- /ai_flow/frontend/webstorm.config.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | 'use strict' 19 | const webpackConfig = require('@vue/cli-service/webpack.config.js') 20 | module.exports = webpackConfig 21 | -------------------------------------------------------------------------------- /ai_flow/metadata/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | 18 | from ai_flow.metadata.message import Message 19 | from ai_flow.metadata.namespace import NamespaceMeta 20 | from ai_flow.metadata.state import WorkflowStateMeta, WorkflowExecutionStateMeta 21 | from ai_flow.metadata.task_execution import TaskExecutionMeta 22 | from ai_flow.metadata.timer import TimerMeta 23 | from ai_flow.metadata.workflow import WorkflowMeta 24 | from ai_flow.metadata.workflow_event_trigger import WorkflowEventTriggerMeta 25 | from ai_flow.metadata.workflow_execution import WorkflowExecutionMeta 26 | from ai_flow.metadata.workflow_schedule import WorkflowScheduleMeta 27 | from ai_flow.metadata.workflow_snapshot import WorkflowSnapshotMeta 28 | -------------------------------------------------------------------------------- /ai_flow/metadata/base.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from sqlalchemy import BigInteger 16 | from sqlalchemy.ext.compiler import compiles 17 | from sqlalchemy.ext.declarative import declarative_base 18 | 19 | Base = declarative_base() 20 | 21 | 22 | @compiles(BigInteger, 'sqlite') 23 | def bi_c(element, compiler, **kw): 24 | return "INTEGER" 25 | -------------------------------------------------------------------------------- /ai_flow/metadata/timer.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | import json 16 | from sqlalchemy import Column, String, Float, LargeBinary 17 | 18 | from ai_flow.metadata.base import Base 19 | 20 | 21 | class TimerMeta(Base): 22 | """ 23 | It represents the metadata of the timer. 24 | """ 25 | 26 | __tablename__ = "timer" 27 | 28 | id = Column(String(256), primary_key=True) 29 | next_run_time = Column(Float(25), nullable=True) 30 | job_state = Column(LargeBinary, nullable=True) 31 | -------------------------------------------------------------------------------- /ai_flow/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/migrations/script.py.mako: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | """${message} 17 | 18 | Revision ID: ${up_revision} 19 | Revises: ${down_revision | comma,n} 20 | Create Date: ${create_date} 21 | 22 | """ 23 | from alembic import op 24 | import sqlalchemy as sa 25 | ${imports if imports else ""} 26 | 27 | # revision identifiers, used by Alembic. 28 | revision = ${repr(up_revision)} 29 | down_revision = ${repr(down_revision)} 30 | branch_labels = ${repr(branch_labels)} 31 | depends_on = ${repr(depends_on)} 32 | 33 | 34 | def upgrade(): 35 | ${upgrades if upgrades else "pass"} 36 | 37 | 38 | def downgrade(): 39 | ${downgrades if downgrades else "pass"} 40 | -------------------------------------------------------------------------------- /ai_flow/migrations/versions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/model/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/model/action.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from enum import Enum 16 | 17 | 18 | class TaskAction(str, Enum): 19 | """ 20 | Enumeration of execution commands for scheduled tasks. 21 | START: Start a task instance. 22 | RESTART: Stop the current task instance and start a new task instance. 23 | STOP: Stop a task instance. 24 | """ 25 | START = "START" 26 | RESTART = "RESTART" 27 | STOP = "STOP" 28 | -------------------------------------------------------------------------------- /ai_flow/model/execution_type.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from enum import Enum 16 | 17 | 18 | class ExecutionType(str, Enum): 19 | """ 20 | Enumeration of execution of workflow and task. 21 | MANUAL: Manually trigger execution. 22 | EVENT: Event triggered execution. 23 | PERIODIC: Periodic triggered execution. 24 | """ 25 | MANUAL = "MANUAL" 26 | EVENT = "EVENT" 27 | PERIODIC = "PERIODIC" 28 | -------------------------------------------------------------------------------- /ai_flow/model/internal/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/notification/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # -------------------------------------------------------------------------------- /ai_flow/operators/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/operators/flink/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/operators/spark/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/rpc/client/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /ai_flow/rpc/client/util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /ai_flow/rpc/protobuf/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/rpc/protobuf/proto/heartbeat_service.proto: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The AI Flow Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, 11 | * software distributed under the License is distributed on an 12 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | * KIND, either express or implied. See the License for the 14 | * specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | syntax = "proto3"; 18 | 19 | option java_generic_services = true; 20 | option java_package = "org.aiflow.client.proto"; 21 | option py_generic_services = true; 22 | option go_package = "/ai_flow"; 23 | 24 | import "message.proto"; 25 | 26 | package ai_flow; 27 | 28 | service HeartbeatService { 29 | rpc send_heartbeat (HeartbeatRequest) returns (Response) { 30 | }; 31 | } 32 | 33 | message HeartbeatRequest { 34 | int64 workflow_execution_id = 1; 35 | string task_name = 2; 36 | int64 sequence_number = 3; 37 | } 38 | -------------------------------------------------------------------------------- /ai_flow/rpc/protobuf/scripts/README.md: -------------------------------------------------------------------------------- 1 | # Codegen 2 | 3 | The Codegen will show you how to install GRPC related dependencies and help you codegen GRPC related code. 4 | 5 | ## Require 6 | 7 | 1. python3.7 8 | 2. pip 9 | 3. go1.14 10 | 11 | ## Install 12 | 13 | ```shell 14 | # install protobuf 15 | wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protobuf-all-3.15.6.tar.gz 16 | tar -zxvf protobuf-all-3.15.6.tar.gz 17 | cd protobuf-3.15.6 18 | ./configure 19 | make 20 | make check 21 | make install 22 | 23 | # install google-api-core 24 | pip install google-api-core==1.26.1 25 | 26 | # install grpcio 27 | pip install grpcio==1.35.0 28 | pip install grpcio-tools==1.35.0 29 | 30 | # install grpc gateway 31 | sh install_grpc_gateway.sh 32 | ``` 33 | 34 | # Codegen 35 | 36 | ```shell 37 | sh gen_protobuf.sh 38 | ``` 39 | -------------------------------------------------------------------------------- /ai_flow/rpc/protobuf/scripts/protoc-gen-grpc-java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/ai_flow/rpc/protobuf/scripts/protoc-gen-grpc-java -------------------------------------------------------------------------------- /ai_flow/rpc/server/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/rpc/service/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /ai_flow/rpc/service/util/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /ai_flow/scheduler/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/scheduler/scheduling_unit.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from typing import Union, Tuple, Optional 16 | 17 | from notification_service.model.event import Event 18 | 19 | from ai_flow.scheduler.rule_wrapper import WorkflowExecutionRuleWrapper, WorkflowRuleWrapper 20 | 21 | SchedulingUnit = Tuple[Event, Optional[Union[WorkflowExecutionRuleWrapper, WorkflowRuleWrapper]]] 22 | -------------------------------------------------------------------------------- /ai_flow/task_executor/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /ai_flow/task_executor/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /ai_flow/task_executor/kubernetes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /ai_flow/task_executor/kubernetes/pod_template_file_sample/pod_template.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | --- 17 | apiVersion: v1 18 | kind: Pod 19 | metadata: 20 | name: base 21 | spec: 22 | containers: 23 | - args: [] 24 | command: [] 25 | env: [] 26 | envFrom: [] 27 | imagePullPolicy: IfNotPresent 28 | name: worker 29 | ports: [] 30 | volumeMounts: 31 | - mountPath: "/opt/aiflow/logs" 32 | name: aiflow-logs 33 | hostNetwork: false 34 | restartPolicy: Never 35 | nodeSelector: 36 | {} 37 | affinity: 38 | {} 39 | tolerations: 40 | [] 41 | volumes: 42 | - name: aiflow-logs 43 | hostPath: 44 | path: /opt/aiflow/logs -------------------------------------------------------------------------------- /ai_flow/task_executor/local/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /ai_flow/version.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | """ 18 | The ai_flow version follows the PEP440. 19 | .. seealso:: https://www.python.org/dev/peps/pep-0440 20 | """ 21 | __version__ = "0.4.dev0" 22 | -------------------------------------------------------------------------------- /bin/init-aiflow-env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | 19 | set -e 20 | 21 | echo "[WARNING] This script will be deprecated, please use 'aiflow' command-line interface." 22 | 23 | aiflow config init 24 | 25 | aiflow db init -------------------------------------------------------------------------------- /bin/start-aiflow.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | set -e 19 | 20 | echo "[WARNING] This script will be deprecated, please use 'aiflow' command-line interface." 21 | 22 | export AIFLOW_HOME=${AIFLOW_HOME:-~/aiflow} 23 | 24 | if [ -e "${AIFLOW_HOME}"/aiflow_server.pid ] || [ -e "${AIFLOW_HOME}"/aiflow_web_server.pid ]; then 25 | echo "AIFlow is running, stopping first" 26 | aiflow server stop 27 | aiflow webserver stop 28 | fi 29 | 30 | aiflow config init 31 | 32 | aiflow db init 33 | 34 | aiflow server start -d 35 | 36 | aiflow webserver start -d 37 | -------------------------------------------------------------------------------- /bin/start_rest_endpoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | python3 server.py >/dev/null 2>&1 & 19 | echo $! >/tmp/pid 20 | nohup go run proxy.go >/dev/null 2>&1 & 21 | -------------------------------------------------------------------------------- /bin/stop-aiflow.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | 19 | set +e 20 | 21 | echo "[WARNING] This script will be deprecated, please use 'aiflow' command-line interface." 22 | 23 | aiflow server stop 24 | 25 | aiflow webserver stop 26 | -------------------------------------------------------------------------------- /bin/stop-all-aiflow-services.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | set -e 19 | 20 | BIN=$(dirname "${BASH_SOURCE-$0}") 21 | BIN=$(cd "$BIN"; pwd) 22 | 23 | aiflow server stop 24 | 25 | aiflow webserver stop 26 | 27 | "${BIN}"/stop-airflow.sh 28 | 29 | notification server stop 30 | -------------------------------------------------------------------------------- /bin/stop_rest_endpoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | cat /tmp/pid | xargs kill 19 | kill -9 $(lsof -i:8080 | tail -1 | awk '"$1"!=""{print $2}') 20 | -------------------------------------------------------------------------------- /chart/Chart.lock: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | dependencies: 16 | - name: postgresql 17 | repository: https://charts.bitnami.com/bitnami 18 | version: 10.5.3 19 | - name: mysql 20 | repository: https://charts.bitnami.com/bitnami 21 | version: 8.8.1 22 | digest: sha256:a7ab1e03dc94624a3705611b5b840b20818a5d58d0683efc6f0f43cfd085a740 23 | generated: "2021-08-04T14:40:41.328392+08:00" 24 | -------------------------------------------------------------------------------- /chart/INSTALL: -------------------------------------------------------------------------------- 1 | ## INSTALL / BUILD instructions for AIFlow Chart 2 | 3 | # The Assumption here is that you have a running Kubernetes cluster 4 | # and helm installed & configured to talk with the cluster 5 | 6 | # RUN `helm dependency` Command 7 | helm dependency build 8 | 9 | # Run `helm install` Command 10 | helm install aiflow . 11 | 12 | # If you want to install in a particular namespace 13 | ## Create that namespace (example 'aiflow' here, change it as needed) 14 | kubectl create namespace aiflow 15 | 16 | ## Install the chart in that namespace 17 | helm install aiflow -n aiflow . 18 | -------------------------------------------------------------------------------- /chart/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Airflow 2 | Copyright 2016-2021 The Apache Software Foundation 3 | 4 | This product includes software developed at The Apache Software 5 | Foundation (http://www.apache.org/). 6 | ======================================================================= 7 | -------------------------------------------------------------------------------- /chart/dockerfiles/README.md: -------------------------------------------------------------------------------- 1 | 17 | 18 | Those are images that are needed for the Helm Chart. 19 | 20 | In each of the images you can find "build_and_push.sh" script that builds and pushes the image. 21 | 22 | You need to be a PMC with direct push access to "apache/airflow" DockerHub registry 23 | to be able to push to the Airflow DockerHub registry. 24 | 25 | You can set the DOCKERHUB_USER variable to push to your own DockerHub user if you want 26 | to test the image or build your own image. 27 | -------------------------------------------------------------------------------- /chart/dockerfiles/statsd-exporter/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | ARG STATSD_VERSION="missing_version" 16 | 17 | FROM prom/statsd-exporter:${STATSD_VERSION} 18 | 19 | ARG STATSD_VERSION 20 | ARG AIRFLOW_STATSD_EXPORTER_VERSION 21 | ARG COMMIT_SHA 22 | 23 | LABEL org.apache.airflow.component="statsd-exporter" 24 | LABEL org.apache.airflow.stasd.version="${STATSD_VERSION}" 25 | LABEL org.apache.airflow.airflow-stasd-exporter.version="${AIRFLOW_STATSD_EXPORTER_VERSION}" 26 | LABEL org.apache.airflow.commit-sha="${COMMIT_SHA}" 27 | LABEL maintainer="Apache Airflow Community " 28 | 29 | COPY mappings.yml /etc/statsd-exporter/mappings.yml 30 | -------------------------------------------------------------------------------- /chart/templates/limitrange.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | ################################ 17 | ## Airflow Namespace LimitRange 18 | ################################# 19 | {{- if .Values.limits }} 20 | apiVersion: v1 21 | kind: LimitRange 22 | metadata: 23 | name: {{ .Release.Name }}-limit-range 24 | labels: 25 | tier: resources 26 | component: limitrange 27 | release: {{ .Release.Name }} 28 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 29 | heritage: {{ .Release.Service }} 30 | {{- with .Values.labels }} 31 | {{ toYaml . | indent 4 }} 32 | {{- end }} 33 | spec: 34 | limits: 35 | {{ toYaml .Values.limits | indent 4 }} 36 | {{- end }} 37 | -------------------------------------------------------------------------------- /chart/templates/resourcequota.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | ################################ 17 | ## Airflow Namespace ResourceQuota 18 | ################################# 19 | {{- if .Values.quotas }} 20 | apiVersion: v1 21 | kind: ResourceQuota 22 | metadata: 23 | name: {{ .Release.Name }}-resource-quota 24 | labels: 25 | tier: resources 26 | component: resourcequota 27 | release: {{ .Release.Name }} 28 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 29 | heritage: {{ .Release.Service }} 30 | {{- with .Values.labels }} 31 | {{ toYaml . | indent 4 }} 32 | {{- end }} 33 | spec: 34 | hard: 35 | {{ toYaml .Values.quotas | indent 4 }} 36 | {{- end }} 37 | -------------------------------------------------------------------------------- /chart/templates/secrets/flower-secret.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | ################################ 17 | ## Flower Secret 18 | ################################# 19 | {{- if (and (not .Values.flower.secretName) .Values.flower.username .Values.flower.password) }} 20 | kind: Secret 21 | apiVersion: v1 22 | metadata: 23 | name: {{ .Release.Name }}-flower 24 | labels: 25 | release: {{ .Release.Name }} 26 | chart: {{ .Chart.Name }} 27 | heritage: {{ .Release.Service }} 28 | {{- with .Values.labels }} 29 | {{ toYaml . | indent 4 }} 30 | {{- end }} 31 | type: Opaque 32 | data: 33 | basicAuth: {{ (printf "%s:%s" .Values.flower.username .Values.flower.password) | b64enc | quote }} 34 | {{- end }} 35 | -------------------------------------------------------------------------------- /chart/templates/secrets/registry-secret.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | ################################ 17 | ## Registry Secret 18 | ################################# 19 | {{- if (and .Values.registry.connection (not .Values.registry.secretName)) }} 20 | kind: Secret 21 | apiVersion: v1 22 | metadata: 23 | name: {{ .Release.Name }}-registry 24 | labels: 25 | release: {{ .Release.Name }} 26 | chart: {{ .Chart.Name }} 27 | heritage: {{ .Release.Service }} 28 | {{- with .Values.labels }} 29 | {{ toYaml . | indent 4 }} 30 | {{- end }} 31 | type: kubernetes.io/dockerconfigjson 32 | data: 33 | .dockerconfigjson: {{ include "registry_docker_config" . | b64enc }} 34 | {{- end }} 35 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Build Documents 2 | 3 | ### Requirement 4 | 1. Python3.7 5 | 2. Sphinx (You can install it via `pip install -U sphinx sphinx_rtd_theme`) 6 | 3. AIFlow 7 | 8 | ### Build 9 | ``` 10 | cd docs/ 11 | bash docgen.sh 12 | make clean html 13 | ``` 14 | 15 | After building, you can view the local document in your browser by typing `open ./_build/html/index.html` in your terminal. 16 | 17 | Or `python -m http.server ` to start a local server which enables users to view the documents on `http://0.0.0.0:8000/_build/html`. -------------------------------------------------------------------------------- /docs/content/architecture/index.md: -------------------------------------------------------------------------------- 1 | # Architecture 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | overview 7 | sdk 8 | aiflow_server 9 | notification_server 10 | scheduler 11 | 12 | ``` -------------------------------------------------------------------------------- /docs/content/architecture/notification_server.md: -------------------------------------------------------------------------------- 1 | # Notification Server 2 | 3 | The figure below shows its working steps: 4 | 5 | ![Alt text](../images/architecture/notification.png) 6 | 7 | 1. A consumer listens the event which the key field equals 'Model'. 8 | 2. A producer sends the event to the Notification Server. 9 | 3. The consumer received the event, and then processes the received event according to the consumer's logic. 10 | 11 | The scenarios of the Notification Server in the AIFlow system are as follows: 12 | 1. Sending/listening events for the scheduler. 13 | For example, when a job ends, it will send a job finished event, 14 | and the scheduler will perform the corresponding scheduling action. 15 | 16 | 2. Sending/listening events for the Meta Service. 17 | For example, when a user registers a new model version, the Meta Service will send a new model version event. 18 | 19 | 3. Sending/listening events for the Jobs. 20 | For example, when a model evaluation job ends, 21 | an event will be generated that represents the result of the model evaluation. 22 | When the downstream job receives this event, it will perform the corresponding action. 23 | 24 | 4. Sending/listening events for the external system. 25 | The external system can send or listen to some user-defined events. -------------------------------------------------------------------------------- /docs/content/architecture/scheduler.md: -------------------------------------------------------------------------------- 1 | # Scheduler 2 | 3 | The common scheduler could only support the scheduling of the batch jobs(It means that after upstream job finished, downstream jobs could run.) 4 | but in the online learning scenario where we have jobs that will never finish, it does not meet the demand. 5 | So The scheduler must support event-based scheduling. 6 | 7 | The figure below shows the difference between traditional scheduling and event-based scheduling: 8 | ![scheduler](../images/architecture/scheduler.png) 9 | With the common scheduler, after upstream jobs finished, downstream jobs can run. 10 | As shown above, after Job_1 and Job_2 are finished,Job_3 can run. 11 | After Job_3 and Job_4 are finished, Job_5 can run. 12 | After Job_3 is finished, Job_6 can run. 13 | 14 | With the event-based scheduler, after receiving necessary events, downstream jobs can run. 15 | As shown above, After receiving event_1 and event_2, Job_3 can run. 16 | After receiving event_3 and event_4, Job_5 can run. 17 | After receiving event_5, Job_6 can run. 18 | 19 | At present, the default scheduler is an [event-based scheduler](https://github.com/flink-extended/ai-flow/tree/master/lib/airflow), which is based on airflow. -------------------------------------------------------------------------------- /docs/content/concepts/index.md: -------------------------------------------------------------------------------- 1 | # Concepts 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | workflows 7 | namespaces 8 | tasks 9 | operators 10 | task_rules 11 | conditions 12 | events 13 | workflow_schedules 14 | workflow_triggers 15 | ``` -------------------------------------------------------------------------------- /docs/content/concepts/namespaces.md: -------------------------------------------------------------------------------- 1 | # Namespaces 2 | 3 | Namespaces provide a mechanism for isolating groups of [Workflows](./workflows.md) within a single cluster. Names of Workflows need to be unique within a namespace, but not across Namespaces. 4 | Multiple business-related Workflows can be put into the same Namespace to have the same access control and Event isolation. 5 | 6 | 7 | ## Creating Namespaces 8 | 9 | AIFlow has a default namespace called `default`. Users can also create their own namespaces if needed through the command-line interface. 10 | 11 | ```shell script 12 | aiflow namespace add user_namespace 13 | ``` 14 | 15 | ## Viewing Namespaces 16 | 17 | ```shell script 18 | aiflow namespace list 19 | ``` 20 | 21 | ## Deleting Namespaces 22 | 23 | ```shell script 24 | aiflow namespace delete user_namespace 25 | ``` -------------------------------------------------------------------------------- /docs/content/concepts/workflow_executions.md: -------------------------------------------------------------------------------- 1 | # Workflow Executions 2 | 3 | A [Workflow](./workflows.md) can be executed to generate runtime instances, which is called Workflow Execution. 4 | 5 | ## Workflow Execution Status 6 | 7 | A Workflow Execution has a Status representing what stage of the lifecycle it is in. The possible Status for a Workflow Execution is: 8 | 9 | - init: The workflow execution is just created. 10 | - running: One or more task of the workflow execution is running. 11 | - success: All tasks of the workflow execution are successful. 12 | - failed: Any of the tasks of the workflow execution is failed. 13 | - stopped: The workflow execution is requested to shut down and successfully stopped 14 | 15 | 16 | ## Creating Workflow Execution 17 | 18 | There are 3 ways to run Workflow and generate Workflow Executions. 19 | 20 | ## Manually 21 | 22 | Users can manually start an execution of a Workflow immediately by the command-line interface. 23 | ```bash 24 | aiflow workflow-execution start my_workflow 25 | ``` 26 | ### Periodically 27 | 28 | A Workflow can be bound to a [Workflow Schedule](./workflow_schedules.md) to make it run periodically. 29 | 30 | ### Driven by Events 31 | 32 | A Workflow can be bound to a [Workflow Trigger](./workflow_triggers.md) to make it can be triggered by Events and Conditions. -------------------------------------------------------------------------------- /docs/content/get_started/index.md: -------------------------------------------------------------------------------- 1 | # Get Started 2 | 3 | ```{toctree} 4 | :maxdepth: 2 5 | 6 | about 7 | quickstart/index 8 | ``` -------------------------------------------------------------------------------- /docs/content/get_started/quickstart/index.md: -------------------------------------------------------------------------------- 1 | # Quickstart 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | locally 7 | in_docker 8 | ``` -------------------------------------------------------------------------------- /docs/content/get_started/quickstart/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | ## 1. pytz.exceptions.UnknownTimeZoneError: 'Can not find any timezone configuration' 4 | 5 | It is a common problem in Ubuntu, the solution is setting the locale environment variable correctly, e.g. 6 | ``` 7 | export TZ=America/Indiana/Indianapolis 8 | ``` 9 | 10 | ## 2. ValueError: unknown locale: UTF-8 11 | 12 | You may meet this error with earlier version of Python, please set the environment variables like below. 13 | 14 | ```text 15 | export LANGUAGE=en_US.UTF-8 16 | export LANG=en_US.UTF-8 17 | export LC_ALL=en_US.UTF-8 18 | export LC_CTYPE=en_US.UTF-8 19 | export LC_MESSAGES=en_US.UTF-8 20 | ``` -------------------------------------------------------------------------------- /docs/content/how_to_guides/index.md: -------------------------------------------------------------------------------- 1 | # How Tos 2 | 3 | 4 | Setting up the sandbox in the [Quick Start](../get_started/quickstart/index.md) section was easy; building a production-grade environment requires a bit more work! 5 | 6 | These how-to guides will step you through workflow development and setting up the AIFlow environment. 7 | 8 | ```{toctree} 9 | :maxdepth: 1 10 | 11 | set_up_mysql_as_backend 12 | ``` -------------------------------------------------------------------------------- /docs/content/images/AIFlow-Deploy-Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/AIFlow-Deploy-Overview.png -------------------------------------------------------------------------------- /docs/content/images/ai_flow_webui.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/ai_flow_webui.jpg -------------------------------------------------------------------------------- /docs/content/images/airflow_login_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/airflow_login_ui.png -------------------------------------------------------------------------------- /docs/content/images/architecture/ai_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/ai_graph.png -------------------------------------------------------------------------------- /docs/content/images/architecture/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/architecture.png -------------------------------------------------------------------------------- /docs/content/images/architecture/meta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/meta.png -------------------------------------------------------------------------------- /docs/content/images/architecture/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/notification.png -------------------------------------------------------------------------------- /docs/content/images/architecture/principle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/principle.png -------------------------------------------------------------------------------- /docs/content/images/architecture/scheduler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/scheduler.png -------------------------------------------------------------------------------- /docs/content/images/architecture/scheduling_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/scheduling_service.png -------------------------------------------------------------------------------- /docs/content/images/architecture/translator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/translator.png -------------------------------------------------------------------------------- /docs/content/images/architecture/workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/architecture/workflow.png -------------------------------------------------------------------------------- /docs/content/images/dingtalk_qr_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/dingtalk_qr_code.png -------------------------------------------------------------------------------- /docs/content/images/functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/functions.png -------------------------------------------------------------------------------- /docs/content/images/machine_learning_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/machine_learning_workflow.png -------------------------------------------------------------------------------- /docs/content/images/simple_workflow_graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/simple_workflow_graph.jpg -------------------------------------------------------------------------------- /docs/content/images/simple_workflow_metadata.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/simple_workflow_metadata.jpg -------------------------------------------------------------------------------- /docs/content/images/sklearn_batch_train_stream_predict_execution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/sklearn_batch_train_stream_predict_execution.png -------------------------------------------------------------------------------- /docs/content/images/sklearn_batch_train_stream_predict_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/sklearn_batch_train_stream_predict_graph.png -------------------------------------------------------------------------------- /docs/content/images/sklearn_batch_train_stream_predict_meta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/sklearn_batch_train_stream_predict_meta.png -------------------------------------------------------------------------------- /docs/content/images/tutorial/channels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/tutorial/channels.png -------------------------------------------------------------------------------- /docs/content/images/tutorial/success_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/docs/content/images/tutorial/success_workflow.png -------------------------------------------------------------------------------- /docs/content/installation/index.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | installing_from_pypi 7 | installing_from_sources 8 | ``` -------------------------------------------------------------------------------- /docs/content/installation/installing_from_sources.md: -------------------------------------------------------------------------------- 1 | # Installing from Sources 2 | 3 | This page describes installations from ai-flow source code. 4 | 5 | ## Prerequisites 6 | 7 | Please make sure you have below tools installed on your workflow station. 8 | 9 | * Git 10 | * Python: 3.7, 3.8 11 | * Pip: 19.0.0+ 12 | * SQLite: 3.15.0+ 13 | 14 | ## Preparing Environment [Optional] 15 | To avoid dependencies conflict, we strongly recommend using [venv](https://docs.python.org/3.7/library/venv.html) or other similar tools for an isolated Python environment like below: 16 | 17 | ```shell 18 | python3 -m venv venv_for_aiflow 19 | source venv_for_aiflow/bin/activate 20 | ``` 21 | 22 | ## Installing wheel 23 | AIFlow would add some entrypoints to `PATH` during installation, which requires package `wheel` installed. 24 | ```shell script 25 | python3 -m pip install wheel 26 | ``` 27 | 28 | ## Downloading Source Code 29 | ```shell script 30 | git clone https://github.com/flink-extended/ai-flow.git 31 | ``` 32 | 33 | ## Installing AIFlow 34 | Now you can install AIFlow by running: 35 | ```shell script 36 | # cd into the source code directory you just cloned 37 | cd ai-flow 38 | 39 | # install notification service 40 | python3 -m pip install lib/notification_service 41 | 42 | # install ai-flow 43 | python3 -m pip install . 44 | ``` 45 | -------------------------------------------------------------------------------- /docs/content/operation/client_configuration.md: -------------------------------------------------------------------------------- 1 | # Client Configurations 2 | 3 | As a client-server application, AIFlow allows users to access the server from any network connected machine. 4 | That means you can upload and manage the workflow from any client. An AIFlow client needs a configuration file `aiflow_client.yaml` under ${AIFLOW_HOME}. 5 | Here are the configurations of the `aiflow_client.yaml`. 6 | 7 | |Key|Type|Default|Description| 8 | |---|---|---|---| 9 | |server_address|String|localhost:50051|The uri of the AIFlow server.| 10 | |blob_manager_class|String|ai_flow.blob_manager.impl.local_blob_manager.LocalBlobManager|The fully-qualified name of the `Blob Manager` class.| 11 | |blob_manager_config|dict|None|Custom configuration of this type of implementation.| 12 | 13 | For the full blob manager config, please refer to [here](../plugins/blob_manager_plugin.md) 14 | 15 | ## Default AIFlow server Configuration 16 | 17 | ```yaml 18 | # address of AIFlow server 19 | server_address: localhost:50051 20 | 21 | # configurations about blob manager 22 | blob_manager: 23 | blob_manager_class: ai_flow.blob_manager.impl.local_blob_manager.LocalBlobManager 24 | blob_manager_config: 25 | root_directory: {AIFLOW_HOME}/blob 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/content/operation/index.md: -------------------------------------------------------------------------------- 1 | # Operation 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | deploying_notification_server 7 | deploying_aiflow_server 8 | client_configuration 9 | 10 | ``` -------------------------------------------------------------------------------- /docs/content/plugins/index.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | blob_manager_plugin 7 | ``` -------------------------------------------------------------------------------- /docs/content/tutorial_and_examples/examples.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Below, you can find a number of examples for various AIFlow use cases. 4 | 5 | * [quickstart](https://github.com/flink-extended/ai-flow/tree/master/samples/quickstart) 6 | * [FlinkOpertor](https://github.com/flink-extended/ai-flow/tree/master/samples/flink_operator) 7 | * [SparkOperator](https://github.com/flink-extended/ai-flow/tree/master/samples/spark_operator) 8 | * [periodic](https://github.com/flink-extended/ai-flow/tree/master/samples/periodic) 9 | * [event triggered workflow](https://github.com/flink-extended/ai-flow/tree/master/samples/event_trigger_workflow) 10 | * [custom condition](https://github.com/flink-extended/ai-flow/tree/master/samples/custom_condition) 11 | -------------------------------------------------------------------------------- /docs/content/tutorial_and_examples/index.md: -------------------------------------------------------------------------------- 1 | # Tutorial and Examples 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | tutorial 7 | examples 8 | ``` -------------------------------------------------------------------------------- /docs/docgen.sh: -------------------------------------------------------------------------------- 1 | ## Copyright 2022 The AI Flow Authors 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, 10 | ## software distributed under the License is distributed on an 11 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | ## KIND, either express or implied. See the License for the 13 | ## specific language governing permissions and limitations 14 | ## under the License. 15 | ## 16 | 17 | set -e 18 | 19 | docs=$(dirname "${BASH_SOURCE[0]}") 20 | docs=$(cd "$docs"; pwd) 21 | workdir=$docs 22 | tmpdir="$workdir"/__tmp 23 | 24 | cd "$workdir" 25 | generated_source="$workdir"/reference/api/python/source_rst 26 | [ -e "${generated_source}" ] && rm -r "${generated_source}" 27 | mkdir "${generated_source}" 28 | 29 | mkdir "$tmpdir" 30 | sphinx-apidoc -f -M -o "$tmpdir"/ "$workdir"/../ai_flow 31 | cp -a "$tmpdir"/. "${generated_source}" 32 | rm -r "$tmpdir" 33 | -------------------------------------------------------------------------------- /docs/reference/api/index.rst: -------------------------------------------------------------------------------- 1 | .. ################################################################################ 2 | Copyright 2022 The AI Flow Authors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ################################################################################ 16 | 17 | 18 | API 19 | ========================================= 20 | 21 | .. toctree:: 22 | :maxdepth: 1 23 | 24 | python/index -------------------------------------------------------------------------------- /docs/reference/api/java/aiflow.md: -------------------------------------------------------------------------------- 1 | # AIFlow 2 | 3 | ## Maven Dependencies 4 | 5 | You can get maven dependencies of AIFlow client from [mavem repository](https://mvnrepository.com/artifact/org.ai-flow/aiflow-client) and add to your `pom.xml`. 6 | These dependencies include a AIFlow GRPC client to visit the Python `AIFlowServer`. 7 | 8 | ## Client JavaDoc 9 | 10 | [https://www.javadoc.io/doc/org.ai-flow/aiflow-client/latest/index.html](https://www.javadoc.io/doc/org.ai-flow/aiflow-client/latest/index.html) 11 | -------------------------------------------------------------------------------- /docs/reference/api/java/index.md: -------------------------------------------------------------------------------- 1 | # Java 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | aiflow 7 | notification 8 | 9 | ``` -------------------------------------------------------------------------------- /docs/reference/api/java/notification.md: -------------------------------------------------------------------------------- 1 | # Notification 2 | 3 | ## Maven Dependencies 4 | 5 | You can get maven dependencies of Notification client from [mavem repository](https://mvnrepository.com/artifact/org.ai-flow/notification-client) and add to your `pom.xml`. 6 | These dependencies include a GRPC client to visit the Python `Notification Server`. 7 | 8 | ## Client JavaDoc 9 | 10 | [https://www.javadoc.io/doc/org.ai-flow/notification-client/latest/index.html](https://www.javadoc.io/doc/org.ai-flow/notification-client/latest/index.html) -------------------------------------------------------------------------------- /docs/reference/api/python/index.rst: -------------------------------------------------------------------------------- 1 | .. ################################################################################ 2 | Copyright 2022 The AI Flow Authors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | ################################################################################ 16 | 17 | 18 | Python 19 | ========================================= 20 | 21 | .. toctree:: 22 | :maxdepth: 1 23 | :caption: Contents 24 | 25 | source_rst/ai_flow 26 | -------------------------------------------------------------------------------- /docs/reference/cli/index.md: -------------------------------------------------------------------------------- 1 | # CLI 2 | 3 | ```{toctree} 4 | :maxdepth: 1 5 | 6 | aiflow 7 | notification 8 | 9 | ``` -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | # Required dependencies 18 | 19 | myst-parser==0.13.6 20 | docutils==0.16 21 | -------------------------------------------------------------------------------- /install_aiflow.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | 19 | set -e 20 | 21 | bin=$(dirname "${BASH_SOURCE[0]}") 22 | bin=$(cd "$bin"; pwd) 23 | workdir=$bin 24 | 25 | # In case of existed typing cause version conflict, uninstall it and then install AIFlow from source 26 | pip uninstall -y typing 27 | 28 | # Compile Web UI frontend of aiflow (yarn is required) 29 | bash "$workdir"/ai_flow/frontend/compile_frontend.sh 30 | # Compile Web UI assets of airflow (yarn is required) 31 | bash "$workdir"/lib/airflow/airflow/www/compile_assets.sh 32 | pip install "$workdir"/lib/notification_service 33 | pip install "$workdir"/lib/airflow 34 | pip install "$workdir" -------------------------------------------------------------------------------- /lib/notification_service/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | graft bin/ 18 | global-exclude __pycache__ *.pyc 19 | graft notification_service/config_templates 20 | -------------------------------------------------------------------------------- /lib/notification_service/README.md: -------------------------------------------------------------------------------- 1 | Notification Service Inferface -------------------------------------------------------------------------------- /lib/notification_service/bin/init-notification-env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | set -e 19 | 20 | echo "[WARNING] This script will be deprecated, please use 'notification' command-line interface." 21 | 22 | notification config init 23 | 24 | notification db init 25 | -------------------------------------------------------------------------------- /lib/notification_service/bin/start-notification.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | set -e 19 | 20 | echo "[WARNING] This script will be deprecated, please use 'notification' command-line interface." 21 | 22 | # start notification service 23 | 24 | export NOTIFICATION_HOME=${NOTIFICATION_HOME:-~/notification_service} 25 | if [ -e "${NOTIFICATION_HOME}"/notification_server.pid ]; then 26 | echo "Notification server is running, stop it first." 27 | notification server stop 28 | fi 29 | 30 | notification config init 31 | 32 | notification db init 33 | 34 | notification server start -d 35 | -------------------------------------------------------------------------------- /lib/notification_service/bin/stop-notification.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | set -e 19 | 20 | echo "[WARNING] This script will be deprecated, please use 'notification' command-line interface." 21 | 22 | notification server stop 23 | -------------------------------------------------------------------------------- /lib/notification_service/java/src/main/java/org/aiflow/notification/client/ListenerProcessor.java: -------------------------------------------------------------------------------- 1 | package org.aiflow.notification.client; 2 | 3 | import org.aiflow.notification.entity.EventMeta; 4 | 5 | import java.util.List; 6 | 7 | public abstract class ListenerProcessor { 8 | abstract void process(List events); 9 | } 10 | -------------------------------------------------------------------------------- /lib/notification_service/java/src/main/java/org/aiflow/notification/client/ListenerRegistrationId.java: -------------------------------------------------------------------------------- 1 | package org.aiflow.notification.client; 2 | 3 | public class ListenerRegistrationId { 4 | private String id; 5 | 6 | public ListenerRegistrationId(String id) { 7 | this.id = id; 8 | } 9 | 10 | public String getId() { 11 | return id; 12 | } 13 | 14 | public void setId(String id) { 15 | this.id = id; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/notification_service/java/src/test/java/org/aiflow/notification/conf/TestConfiguration.java: -------------------------------------------------------------------------------- 1 | package org.aiflow.notification.conf; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.Properties; 6 | 7 | import static org.junit.Assert.assertEquals; 8 | import static org.junit.Assert.assertFalse; 9 | import static org.junit.Assert.assertTrue; 10 | 11 | public class TestConfiguration { 12 | @Test 13 | public void testGetBoolean() { 14 | Properties props = new Properties(); 15 | props.put("a", "true"); 16 | props.put("b", "FALse"); 17 | props.put("c", "123"); 18 | Configuration conf = new Configuration(props); 19 | assertTrue(conf.getBoolean("a", false)); 20 | assertFalse(conf.getBoolean("b", false)); 21 | assertFalse(conf.getBoolean("c", false)); 22 | assertTrue(conf.getBoolean("d", true)); 23 | } 24 | 25 | @Test 26 | public void testGetInt() { 27 | Properties props = new Properties(); 28 | props.put("a", "1"); 29 | Configuration conf = new Configuration(props); 30 | assertEquals(1, conf.getInt("a", 0)); 31 | assertEquals(1, conf.getLong("a", 0)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/notification_service/java/src/test/resources/notification_server.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from notification_service.storage.in_memory.memory_event_storage import MemoryEventStorage 16 | from notification_service.server.server import NotificationServer 17 | from notification_service.rpc.service import NotificationService 18 | 19 | 20 | def run_server(): 21 | storage = MemoryEventStorage() 22 | master = NotificationServer(service=NotificationService(storage), port=50051) 23 | master.run(is_block=True) 24 | 25 | 26 | if __name__ == '__main__': 27 | run_server() 28 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # PYTHON_ARGCOMPLETE_OK 3 | # 4 | # Copyright 2022 The AI Flow Authors 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | """Main executable module""" 20 | 21 | import argcomplete 22 | 23 | from notification_service.cli import cli_parser 24 | 25 | 26 | def main(): 27 | """Main executable function""" 28 | 29 | parser = cli_parser.get_parser() 30 | argcomplete.autocomplete(parser) 31 | args = parser.parse_args() 32 | args.func(args) 33 | 34 | 35 | if __name__ == '__main__': 36 | main() 37 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/cli/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/cli/commands/version_command.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | """Version command""" 16 | from notification_service.version import __version__ 17 | 18 | 19 | def version(args): 20 | """Displays Notification version at the command line""" 21 | print(__version__) 22 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/notification_service/client/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/notification_service/config_templates/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/config_templates/default_notification_server.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | # port of notification server 17 | server_port: 50052 18 | 19 | # uri of database backend for notification server 20 | db_uri: sqlite:///{NOTIFICATION_HOME}/ns.db 21 | 22 | # whether to start server in HA mode 23 | # enable_ha: False 24 | 25 | # time to detect living members in HA mode 26 | # ha_ttl_ms: 10000 27 | 28 | # uri of server registered in HA manager for clients to use 29 | # advertised_uri: localhost:50052 30 | 31 | # timeout for notification server to be available after started in seconds, defaults to 5.0 32 | # wait_for_server_started_timeout: 5.0 33 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/migrations/script.py.mako: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | """${message} 17 | 18 | Revision ID: ${up_revision} 19 | Revises: ${down_revision | comma,n} 20 | Create Date: ${create_date} 21 | 22 | """ 23 | from alembic import op 24 | import sqlalchemy as sa 25 | ${imports if imports else ""} 26 | 27 | # revision identifiers, used by Alembic. 28 | revision = ${repr(up_revision)} 29 | down_revision = ${repr(down_revision)} 30 | branch_labels = ${repr(branch_labels)} 31 | depends_on = ${repr(depends_on)} 32 | 33 | 34 | def upgrade(): 35 | ${upgrades if upgrades else "pass"} 36 | 37 | 38 | def downgrade(): 39 | ${downgrades if downgrades else "pass"} 40 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/migrations/versions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/model/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/notification_service/model/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/notification_service/model/member.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | 18 | 19 | class Member(object): 20 | 21 | def __init__(self, version, server_uri, update_time): 22 | self.version = version 23 | self.server_uri = server_uri 24 | self.update_time = update_time 25 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/model/sender_event_count.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | 18 | 19 | class SenderEventCount(object): 20 | def __init__(self, sender: str, event_count: int): 21 | self.sender = sender 22 | self.event_count = event_count 23 | 24 | def __str__(self) -> str: 25 | return 'sender:{0}, event_count:{1}'.format(self.sender, self.event_count) 26 | 27 | def __eq__(self, other): 28 | if not isinstance(other, SenderEventCount): 29 | return False 30 | return self.sender == other.sender and self.event_count == other.event_count 31 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/rpc/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/rpc/protobuf/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/rpc/protobuf/scripts/protoc-gen-grpc-java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/notification_service/rpc/protobuf/scripts/protoc-gen-grpc-java -------------------------------------------------------------------------------- /lib/notification_service/notification_service/server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/notification_service/server/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/notification_service/storage/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # -------------------------------------------------------------------------------- /lib/notification_service/notification_service/storage/alchemy/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | 16 | from notification_service.storage.alchemy.db_event_storage import EventModel 17 | from notification_service.storage.alchemy.db_high_availability_storage import MemberModel 18 | from notification_service.storage.alchemy.db_client_storage import ClientModel 19 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/storage/alchemy/base.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from sqlalchemy import BigInteger 16 | from sqlalchemy.ext.compiler import compiles 17 | from sqlalchemy.ext.declarative import declarative_base 18 | 19 | Base = declarative_base() 20 | 21 | 22 | @compiles(BigInteger, 'sqlite') 23 | def bi_c(element, compiler, **kw): 24 | return "INTEGER" 25 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/storage/high_availability.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | from abc import ABC, abstractmethod 18 | from typing import List 19 | 20 | from notification_service.model.member import Member 21 | 22 | 23 | class HighAvailabilityStorage(ABC): 24 | 25 | @abstractmethod 26 | def list_living_members(self, ttl_ms) -> List[Member]: 27 | pass 28 | 29 | @abstractmethod 30 | def update_member(self, server_uri, server_uuid): 31 | pass 32 | 33 | @abstractmethod 34 | def clear_dead_members(self, ttl_ms): 35 | pass -------------------------------------------------------------------------------- /lib/notification_service/notification_service/storage/in_memory/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/notification_service/storage/in_memory/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/notification_service/storage/mongo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/notification_service/storage/mongo/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/notification_service/util/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/notification_service/version.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | """ 18 | The notification_service version follows the PEP440. 19 | .. seealso:: https://www.python.org/dev/peps/pep-0440 20 | """ 21 | __version__ = "0.4.dev0" 22 | -------------------------------------------------------------------------------- /lib/notification_service/requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | 18 | protobuf==3.15.6 19 | grpcio==1.35.0 20 | sqlalchemy>=1.3.18, <2 21 | pyyaml>=5.1, <5.4 22 | rich==9.2.0 23 | python-dateutil>=2.8, <3 24 | alembic>=1.2, <2.0 25 | python-daemon>=2.1.1, <2.2 26 | -------------------------------------------------------------------------------- /lib/notification_service/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/tests/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/tests/cli/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /lib/notification_service/tests/client/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/tests/client/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/tests/server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/lib/notification_service/tests/server/__init__.py -------------------------------------------------------------------------------- /lib/notification_service/tests/util/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /licenses/LICENSE-bootstrap-toggle.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2014 Min Hur, The New York Times Company 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /licenses/LICENSE-bootstrap.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2017 Twitter, Inc. 4 | Copyright (c) 2011-2017 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /licenses/LICENSE-bootstrap3-typeahead.txt: -------------------------------------------------------------------------------- 1 | /* ============================================================= 2 | * bootstrap3-typeahead.js v4.0.2 3 | * https://github.com/bassjobsen/Bootstrap-3-Typeahead 4 | * ============================================================= 5 | * Original written by @mdo and @fat 6 | * ============================================================= 7 | * Copyright 2014 Bass Jobsen @bassjobsen 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the 'License'); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an 'AS IS' BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | * ============================================================ */ 21 | -------------------------------------------------------------------------------- /licenses/LICENSE-d3-tip.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2013 Justin Palmer 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 7 | and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions 10 | of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 13 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 14 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 15 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 16 | DEALINGS IN THE SOFTWARE. 17 | -------------------------------------------------------------------------------- /licenses/LICENSE-dagre-d3.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2014 Chris Pettitt 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /licenses/LICENSE-datatables.txt: -------------------------------------------------------------------------------- 1 | MIT license 2 | Copyright (C) 2008-2017, SpryMedia Ltd. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 7 | and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions 10 | of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 13 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 14 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 15 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 16 | DEALINGS IN THE SOFTWARE. 17 | -------------------------------------------------------------------------------- /licenses/LICENSE-elasticmock.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Marcos Cardoso 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /licenses/LICENSE-eonasdan-bootstrap-datetimepicker.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jonathan Peterson (@Eonasdan) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /licenses/LICENSE-moment-strftime.txt: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2012 Benjamin Oakes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /licenses/LICENSE-moment.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) JS Foundation and other contributors 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /licenses/LICENSE-normalize.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © Nicolas Gallagher and Jonathan Neal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /licenses/LICENSE-python-nvd3.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Python-nvd3 4 | 5 | Copyright (c) 2013 Arezqui Belaid and other contributors 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /licenses/LICENSE-python-slugify.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) Val Neekman @ Neekware Inc. http://neekware.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /licenses/LICENSE-underscorejs.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Jeremy Ashkenas, DocumentCloud and Investigative 2 | Reporters & Editors 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /licenses/LICENSE-webgl-2d.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Corban Brook 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | coverage>=6.1.1 2 | apache-flink==1.14.2 3 | flake8 4 | pytest 5 | mock 6 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Copyright 2022 The AI Flow Authors 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, 12 | ## software distributed under the License is distributed on an 13 | ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ## KIND, either express or implied. See the License for the 15 | ## specific language governing permissions and limitations 16 | ## under the License. 17 | ## 18 | set -e 19 | 20 | coverage run -m unittest discover -v lib/notification_service/tests 21 | 22 | coverage run -m unittest discover -v tests 23 | 24 | coverage combine 25 | coverage report 26 | coverage xml 27 | -------------------------------------------------------------------------------- /samples/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /samples/online_machine_learning/dataset/mnist_evaluate.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/samples/online_machine_learning/dataset/mnist_evaluate.npz -------------------------------------------------------------------------------- /samples/online_machine_learning/dataset/mnist_predict.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/samples/online_machine_learning/dataset/mnist_predict.npz -------------------------------------------------------------------------------- /samples/online_machine_learning/dataset/mnist_train.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flink-extended/ai-flow/4cba53653083478a04cfc6de3c4943da044b5d79/samples/online_machine_learning/dataset/mnist_train.npz -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/blob_manager/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/blob_manager/impl/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/common/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/common/configuration/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/common/util/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/common/util/db_util/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/common/util/for_test_workflow_utils/artifact/artifact.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/common/util/test_string_utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | import unittest 18 | 19 | from ai_flow.common.util.string_utils import mask_cmd 20 | 21 | 22 | class TestThreadUtils(unittest.TestCase): 23 | 24 | def test_masks_passwords(self) -> None: 25 | command_masked = mask_cmd(["spark-submit", "foo", "--bar", "baz", '--password=secret']) 26 | self.assertEqual('spark-submit foo --bar baz --password=******', command_masked) -------------------------------------------------------------------------------- /tests/common/util/test_thread_utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | import time 18 | import unittest 19 | 20 | from ai_flow.common.util.thread_utils import StoppableThread 21 | 22 | 23 | class TestStoppableThread(StoppableThread): 24 | def run(self) -> None: 25 | while not self.stopped(): 26 | time.sleep(1) 27 | print('waiting...') 28 | 29 | 30 | class TestThreadUtils(unittest.TestCase): 31 | 32 | def test_stoppable_thread(self): 33 | test_thread = TestStoppableThread() 34 | test_thread.start() 35 | time.sleep(1) 36 | test_thread.stop() 37 | test_thread.join() 38 | self.assertTrue(test_thread.stopped()) 39 | -------------------------------------------------------------------------------- /tests/metadata/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/model/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/model/internal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/notification/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/operators/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/operators/flink/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/operators/spark/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 The AI Flow Authors 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/ops/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/rpc/__init__.py: -------------------------------------------------------------------------------- 1 | ## Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/scheduler/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | -------------------------------------------------------------------------------- /tests/scheduler/test_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | from tests.test_utils.unittest_base import BaseUnitTest 16 | from ai_flow.metadata.metadata_manager import MetadataManager 17 | 18 | 19 | class UnitTestWithMetadataManager(BaseUnitTest): 20 | def setUp(self) -> None: 21 | super().setUp() 22 | self.metadata_manager = MetadataManager(session=self.session) 23 | 24 | 25 | class UnitTestWithNamespace(UnitTestWithMetadataManager): 26 | def setUp(self) -> None: 27 | super().setUp() 28 | self.namespace_name = 'namespace' 29 | self.namespace_meta = self.metadata_manager.add_namespace(name=self.namespace_name, properties={'a': 'a'}) 30 | self.metadata_manager.flush() 31 | -------------------------------------------------------------------------------- /tests/task_executor/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/task_executor/common/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/task_executor/kubernetes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/task_executor/kubernetes/pod_for_deserialize.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | --- 16 | apiVersion: v1 17 | kind: Pod 18 | metadata: 19 | name: for-unittest 20 | namespace: for-unittest 21 | spec: 22 | containers: 23 | - name: unittest-ctr 24 | image: aiflow/aiflow:latest 25 | resources: 26 | limits: 27 | memory: "200Mi" 28 | requests: 29 | memory: "100Mi" 30 | command: ["ps"] 31 | args: ["--vm", "1", "--vm-bytes", "150M", "--vm-hang", "1"] 32 | -------------------------------------------------------------------------------- /tests/task_executor/local/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/test_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The AI Flow Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, 10 | # software distributed under the License is distributed on an 11 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 | # KIND, either express or implied. See the License for the 13 | # specific language governing permissions and limitations 14 | # under the License. 15 | --------------------------------------------------------------------------------