# suno-glue

glue repository for suno

## How to create a new dump glue job

### **Code change**

#### **Create new Jobs**
1. adding the folder and glue job code to the scripts file, exp: `scripts/<your folders>/<job_name>.py`.
2. adding the glue job configuration json file in the same folder with <job_name.py>, and the name should be `config.json`
3. push your code change to any test branch, this will trigger the cicd pipeline to create a glue job on the staging aws account.
4. you can either test the glue job in the aws console or test the job with the following command if you setup aws in your local and connect to staging or aws account: 
    1. trigger a glue job 
    ```
    aws glue start-job-run --job-name "<your glue job name>" --profile staging
    ```
    2. checking the running result
    ```
    aws glue get-job-run --job-name "rds_to_s3_all_tables_weekly_created" --run-id "jr_e02348a36eb5ad6b8953494fde767383fa0a9cd825598e0b612b9b6eb357864e" --profile staging
    ```
5. after testing, can push all the changes to main branch. 
6. do a final verification of the glue job your created with the link in step 3. 
7. after deploy the glue job to main branch it will automatically adding to the job monitor, if the glue job run failed or timeout, it will send an alert to slack `#tech-alert` room.
8. reaching our to core team if you want to adding one more `<source>_to_<destination>` folder, core team will help you adding the new folder name to monitor. 

#### **Create new utils functions**
1. adding the dependences to the requirement.txt file with `uv add <dependencies name>`.
2. adding the folder and utils code to the utils file.
3. push your code change to any test branch, this will trigger the cicd pipeline to push the code to prod S3 codebase.
4. push your code change to main branch, this will trigger the cicd pipeline to push the code to prod S3 codebase.

### **How to setup aws account locally**

Install AWS CLI if you haven’t by following this guide:

https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Install AWS CDK CLI if you haven’t by following this guide:

https://docs.aws.amazon.com/cdk/v2/guide/cli.html

verify installation by type in these in the commandline

```jsx
aws;
cdk;
```

you should see cli ops.

You need a pair of aws prod key to do this deployment, normally you can use the key pair you use in your `.env` file for your local `studio_api` build, if you have trouble doing this, reach out to @Rider

run `aws configure` to set up aws cli, select default region to be `us-east-2` and output format `json`

also, to run CDK deployment, you need AWS cli staging and prod profile configuration

```jsx
aws configure --profile staging // with your staging aws key
```