---
# System prepended metadata

title: Untitled

---

Tool Required: Flytectl (In sandbox he doesn't need pyflyte/jflyte because we are running command in sandbox. You only need pyflyte/jflyte on production) 

**Workflow defination file for automating the ci tooling** 

```yaml 
# workflows.yaml, It will exist in root directory of flytesnacks 
- workflows:
    - id: core
      name: core
      path: cookbook/core
      name_template: {{ .name }}-{{ .version }}-python-core.tar.gz
      proto_path: "__proto"
      compress: true
    - id: hive-plugin
      name: hive plugin
      path: cookbook/integration/hive
      proto_path: "__proto"
      name_template: {{ .name }}-{{ .version }}-python-integration.tar.gz
      compres: true
    - id: javakit-core
      name: Javakit for example
      path: cookbook/javakit/core
      proto_path: "__proto"
      name_template: {{ .name }}-{{ .version }}-java-core.tar.gz
      compress: false
```

FLytectl commands 

Note **--sandbox** - It will enable a feature where we will run all these command inside a container but for production you don't need sandbox because ci pipeline always has all the basic tooling in place and pip install will work fine. 

```bash
$ flytectl run -f workflows.yaml -p flytesnacks -d development --command="pip install -r requirment.txt && make serialize" --worker=5 --version=v1.10 --sandbox
$ flytectl register files -f workflows.yaml -p flytesnacks -d development --worker=5 --version=v1.10 --sandbox
$ flytectl run -f workflows.yaml -p flytesnacks -d development --worker=5 --command="make release" --version=v1.10 --sandbox (Inside makefile of the workflow we can add new command release which will publish workflow tar in anywhere s3/gcp) 


$ flytectl run core -f workflows.yaml -p flytesnacks -d development --command="pip install -r requirment.txt && make serialize"
$ flytectl register files core -f workflows.yaml -p flytesnacks -d development --worker=5
$ flytectl run core -f workflows.yaml -p flytesnacks -d development --worker=5 --command="make release" 
```


After this change people only see one standard makefile. it will exist in our python-flyte-template(we will also add one for javakit). People can modify it as per there requirement


New flytesnacks flow:
```bash
$ brew install flytectl
$ flytectl sandbox start --flytesnack=$(pwd)
$ flytectl run core -f workflows.yaml -p flytesnacks -d development --command="pip install -r requirment.txt && make serialize" --sandbox
$ flytectl register files core -f workflows.yaml -p flytesnacks -d development --sandbox
$  flytectl fast_register files core -f workflows.yaml -p flytesnacks -d development --sandbox

# Serialize all example
$ flytectl run -f workflows.yaml -p flytesnacks -d development --command="pip install -r requirment.txt && make serialize" --worker=5 --version=v1.10 --sandbox
$ flytectl register files -f workflows.yaml -p flytesnacks -d development --worker=5 --version=v1.10 --sandbox
$ flytectl fast_register files -f workflows.yaml -p flytesnacks -d development --sandbox
```


New flytesnack Release 

```bash 
$ brew install flytectl
$ flytectl sandbox start --flytesnack=$(pwd)
$ flytectl run -f workflows.yaml -p flytesnacks -d development --command="pip install -r requirment.txt && make serialize" --worker=5 
$ flytectl register files -f workflows.yaml -p flytesnacks -d development --worker=5 --version=v1.10
$ flytectl run -f workflows.yaml -p flytesnacks -d development --command="make test" --worker=5 (Basic pytest for now)
$ flytectl run core -f workflows.yaml -p flytesnacks -d development --worker=5 --command="make release" (In our case we will copy the tar in a specific dir, we do not want s3/gcs. Goreleaser will publish all files in github release)
```