# Phase 0 Cleanup Commands

## Snowflake Cleanup (Based on container_runtime_setup.sql Step 10)

### Drop Streamlit Apps Created During Phase 0 Testing
```sql
-- Phase 0 test apps
DROP STREAMLIT IF EXISTS spark_test_1_basic;
DROP STREAMLIT IF EXISTS spark_test_3_api;
DROP STREAMLIT IF EXISTS spark_test_4_packages;
DROP STREAMLIT IF EXISTS spark_test_5_modular;
```

### Clean Stage Files
```sql
-- Remove all files from stage
REMOVE @spark_streamlit_stage;
```

### Optional: Complete Infrastructure Cleanup
```sql
-- Only run if you want to completely tear down the Container Runtime setup
-- WARNING: This will remove all infrastructure for the POC

-- Drop stage
DROP STAGE IF EXISTS spark_streamlit_stage;

-- Drop external access integration
DROP INTEGRATION IF EXISTS spark_external_access;

-- Drop network rules
DROP NETWORK RULE IF EXISTS spark_pypi_rule;
DROP NETWORK RULE IF EXISTS spark_api_testing_rule;
DROP NETWORK RULE IF EXISTS spark_specific_endpoints_rule;

-- Drop compute pool (will fail if apps are still running)
DROP COMPUTE POOL IF EXISTS spark_streamlit_pool;
```

## File System Cleanup Status

### Test Files Organization
- **Phase 0 test files preserved** for reference in `hello_world_tests/`
- **Successful tests**: test_1_basic.py, test_3_api.py, test_4_packages.py
- **Archive folder created** for intermediate test attempts
- **Key learnings documented** in Phase0_Results.md

### Recommended Cleanup Actions
1. **Keep infrastructure** (compute pool, network rules, stage) for POC development
2. **Remove only test apps** to clean up workspace
3. **Preserve stage** for POC deployment
4. **Document learnings** for future reference

### Next Steps After Cleanup
- Infrastructure ready for POC development
- Single-file architecture validated and documented
- Container Runtime patterns established
- Ready to proceed with Spark POC implementation