opencloudtool 0.4.1__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opencloudtool-0.4.2/PKG-INFO +45 -0
- opencloudtool-0.4.2/README.md +38 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/README.md +67 -0
- opencloudtool-0.4.2/crates/oct-cloud/src/infra/resource.rs +3060 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/README.md +67 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/src/oct_ctl_sdk.rs +2 -2
- opencloudtool-0.4.2/crates/oct-py/README.md +38 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-py/src/lib.rs +2 -2
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/pyproject.toml +2 -2
- opencloudtool-0.4.1/PKG-INFO +0 -63
- opencloudtool-0.4.1/README.md +0 -56
- opencloudtool-0.4.1/crates/oct-cloud/src/infra/resource.rs +0 -990
- opencloudtool-0.4.1/crates/oct-py/README.md +0 -56
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/Cargo.lock +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/Cargo.toml +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/Cargo.toml +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/aws/client.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/aws/mod.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/aws/resource.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/aws/types.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/infra/graph.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/infra/mod.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/infra/state.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/lib.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/resource.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-cloud/src/state.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/Cargo.toml +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/src/backend.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/src/config.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/src/lib.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/src/scheduler.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-orchestrator/src/user_state.rs +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-py/.python-version +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-py/Cargo.toml +0 -0
- {opencloudtool-0.4.1/crates/oct-py/python/oct → opencloudtool-0.4.2/crates/oct-py/python/opencloudtool}/__init__.py +0 -0
- {opencloudtool-0.4.1/crates/oct-py/python/oct → opencloudtool-0.4.2/crates/oct-py/python/opencloudtool}/py_api.py +0 -0
- {opencloudtool-0.4.1 → opencloudtool-0.4.2}/crates/oct-py/uv.lock +0 -0
- {opencloudtool-0.4.1/python/oct → opencloudtool-0.4.2/python/opencloudtool}/__init__.py +0 -0
- {opencloudtool-0.4.1/python/oct → opencloudtool-0.4.2/python/opencloudtool}/py_api.py +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opencloudtool
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Requires-Python: >=3.8
|
|
5
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
6
|
+
|
|
7
|
+
# Opencloudtool Python Library
|
|
8
|
+
|
|
9
|
+
A tool to hide the complexity of the cloud, now available as a Python library.
|
|
10
|
+
This library allows you to deploy services directly from your Python scripts.The core of this library is written in Rust
|
|
11
|
+
for high performance and reliability.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
You can install the library from PyPI using `pip`
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install opencloudtool
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Basic Usage
|
|
23
|
+
|
|
24
|
+
To use the library, you need an `oct.toml` configuration file in your project directory.
|
|
25
|
+
The library provides `deploy` and `destroy` functions to manage your stack.
|
|
26
|
+
|
|
27
|
+
Example `deploy.py`
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
import opencloudtool as oct
|
|
31
|
+
|
|
32
|
+
# The path to the project directory containing oct.toml
|
|
33
|
+
project_path = "./my-app"
|
|
34
|
+
|
|
35
|
+
oct.deploy(path=project_path)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To destroy infrastructure:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
oct.destroy(path=project_path)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Main repo [opencloudtool](https://github.com/opencloudtool/opencloudtool)
|
|
45
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Opencloudtool Python Library
|
|
2
|
+
|
|
3
|
+
A tool to hide the complexity of the cloud, now available as a Python library.
|
|
4
|
+
This library allows you to deploy services directly from your Python scripts.The core of this library is written in Rust
|
|
5
|
+
for high performance and reliability.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
You can install the library from PyPI using `pip`
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install opencloudtool
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Basic Usage
|
|
17
|
+
|
|
18
|
+
To use the library, you need an `oct.toml` configuration file in your project directory.
|
|
19
|
+
The library provides `deploy` and `destroy` functions to manage your stack.
|
|
20
|
+
|
|
21
|
+
Example `deploy.py`
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
import opencloudtool as oct
|
|
25
|
+
|
|
26
|
+
# The path to the project directory containing oct.toml
|
|
27
|
+
project_path = "./my-app"
|
|
28
|
+
|
|
29
|
+
oct.deploy(path=project_path)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To destroy infrastructure:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
oct.destroy(path=project_path)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Main repo [opencloudtool](https://github.com/opencloudtool/opencloudtool)
|
|
@@ -19,6 +19,8 @@ or
|
|
|
19
19
|
wget -qO- https://repo.opencloudtool.com/install.sh | sh
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
Optional [install as Python library.](/crates/oct-py/README.md)
|
|
23
|
+
|
|
22
24
|
## Log in to AWS
|
|
23
25
|
|
|
24
26
|
Basic login ([docs](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configure/index.html)):
|
|
@@ -104,6 +106,71 @@ For example:
|
|
|
104
106
|
cargo run -p oct-cli deploy --help
|
|
105
107
|
```
|
|
106
108
|
|
|
109
|
+
### Python Library Development
|
|
110
|
+
|
|
111
|
+
#### How it works: Python-Rust binding
|
|
112
|
+
|
|
113
|
+
#### The connection between Python and Rust is managed by `maturin` and `PyO3`
|
|
114
|
+
|
|
115
|
+
1. `maturin` compiles the Rust code in the `oct-py` crate into a native Python module.
|
|
116
|
+
2. We configure the name of this compiled module in `pyproject.toml` to be `oct._internal`.
|
|
117
|
+
3. The leading underscore (`_`) is a standard Python convention that signals that `_internal` is a low-level module not meant for direct use.
|
|
118
|
+
4. Our user-facing Python code in `oct/py_api.py` imports functions from `_internal` and presents them as a clean, stable API.
|
|
119
|
+
|
|
120
|
+
#### 1. Navigate to the Python Directory
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cd crates/oct-py
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
#### 2. Create and activate the Virtual environment
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
uv venv
|
|
130
|
+
|
|
131
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### 3. Install dependencies
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
uv sync --group dev
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### 4. Build the Library
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
maturin develop
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### 5. Run the example
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
cd ../../examples/projects/single-host-python-lib
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
You can now run `python deploy.py` or `python destroy.py` to test your changes.
|
|
153
|
+
|
|
154
|
+
### Releasing the Python Library
|
|
155
|
+
|
|
156
|
+
#### Bump the Version Number
|
|
157
|
+
|
|
158
|
+
1. Before releasing, you must increment the version number. PyPI will not accept a version that already exists. Update the version in both
|
|
159
|
+
of these files to keep them synchronized:
|
|
160
|
+
|
|
161
|
+
- `crates/oct-py/pyproject.toml`
|
|
162
|
+
- `crates/oct-py/Cargo.toml`
|
|
163
|
+
|
|
164
|
+
2. Build & upload the Release Packages:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
maturin sdist
|
|
168
|
+
|
|
169
|
+
maturin build --release
|
|
170
|
+
|
|
171
|
+
twine upload target/sdist/* target/wheels/*
|
|
172
|
+
```
|
|
173
|
+
|
|
107
174
|
### Writing tests
|
|
108
175
|
|
|
109
176
|
[WIP] Main principles:
|