Metadata-Version: 2.4
Name: pycloudrun
Version: 0.3.8
Summary: 把本地 Python 计算提交到自租云服务器执行：增量同步文件与环境，实时查看日志，作业结束后取回结果
Author-email: youtian95 <youtian95@qq.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/youtian95/cloudrun
Project-URL: Repository, https://github.com/youtian95/cloudrun
Project-URL: Issues, https://github.com/youtian95/cloudrun/issues
Keywords: cloud,remote-compute,hpc,opensees,scientific-computing
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aliyun-python-sdk-core>=2.13
Requires-Dist: paramiko>=3.0
Requires-Dist: pyyaml>=6.0
Dynamic: license-file

# cloudrun

[简体中文](readme_cn.md)

Run local Python computations on a Linux cloud server. Cloudrun syncs changed project files, sets up the Python environment, streams logs during the job, and downloads results when the job exits.

| Provider | Alibaba Cloud | AWS | Azure | Google Cloud | Tencent Cloud | Huawei Cloud | DigitalOcean |
|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| Instance automation | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |

## Quick start

1. Install the CLI with `uv`.

   ```powershell
   uv tool install pycloudrun
   ```

   The standard installation includes the Alibaba Cloud SDK. To install from a source checkout in editable mode, run `uv tool install --editable .` from the repository root.

2. Run `cloudrun init` in your project directory to generate `config_cloudrun.yaml`. If you have a Cloudrun configuration from an earlier release, rename it from `config.yaml` to `config_cloudrun.yaml` to keep your settings.

3. Fill in `config_cloudrun.yaml`. For an existing server, configure the SSH connection under `server` and set `provider.aliyun.enabled` to `false`. For Alibaba Cloud provisioning, set `provider.aliyun.enabled` to `true` and provide `ALIBABA_CLOUD_ACCESS_KEY_ID` and `ALIBABA_CLOUD_ACCESS_KEY_SECRET` as environment variables.

4. Submit your Python script or module from the project directory.

   ```powershell
   cloudrun run script.py
   cloudrun run -m my_package.my_module
   ```

## Commands

| Command | What it does |
|---|---|
| `init [directory] [--force]` | Generate `config_cloudrun.yaml`. |
| `size` | Estimate the full upload size locally. Applies `sync.exclude` and counts `env.wheels` separately. |
| `push` | Sync project files and the Python environment without starting a job. |
| `run [python arguments…]` | Sync and run a job, stream its logs, and download results when it exits. Set `run.detach` to start the job in the background. |
| `fetch` | Download new and changed files. |
| `logs [--tail N] [--follow]` | View or follow job logs. |
| `status` | Check whether the job is running. |
| `up` | Create or start an instance and obtain its public IP address. |
| `down` | Stop the instance. |
| `destroy [--cleanup]` | Release the instance. Use `--cleanup` to also remove the associated network resources and key pair. |
