openshell 0.0.0a0__tar.gz → 0.1.8__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.
- openshell-0.1.8/.gitattributes +7 -0
- openshell-0.1.8/.github/CODEOWNERS +5 -0
- openshell-0.1.8/.github/ISSUE_TEMPLATE/bug_report.yml +97 -0
- openshell-0.1.8/.github/ISSUE_TEMPLATE/config.yml +14 -0
- openshell-0.1.8/.github/ISSUE_TEMPLATE/feature_request.yml +86 -0
- openshell-0.1.8/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- openshell-0.1.8/.github/dependabot.yml +20 -0
- openshell-0.1.8/.github/workflows/ci.yml +96 -0
- openshell-0.1.8/.github/workflows/codeql.yml +46 -0
- openshell-0.1.8/.github/workflows/core-drift.yml +59 -0
- openshell-0.1.8/.github/workflows/core-watch.yml +84 -0
- openshell-0.1.8/.github/workflows/e2e.yml +65 -0
- openshell-0.1.8/.github/workflows/release.yml +144 -0
- openshell-0.1.8/.gitignore +14 -0
- openshell-0.1.8/.python-version +1 -0
- openshell-0.1.8/AGENTS.md +34 -0
- openshell-0.1.8/CONTRIBUTING.md +104 -0
- openshell-0.1.8/LICENSE +202 -0
- openshell-0.1.8/PKG-INFO +186 -0
- openshell-0.1.8/README.md +154 -0
- openshell-0.1.8/SECURITY.md +15 -0
- openshell-0.1.8/mise.toml +168 -0
- openshell-0.1.8/pyproject.toml +135 -0
- openshell-0.1.8/scripts/README.md +44 -0
- openshell-0.1.8/scripts/core-sync/bump-pr-body.md +16 -0
- openshell-0.1.8/scripts/core-sync/core-tags.sh +72 -0
- openshell-0.1.8/scripts/core-sync/drift-check.sh +131 -0
- openshell-0.1.8/scripts/core-sync/drift-issue.sh +35 -0
- openshell-0.1.8/scripts/core-sync/open-bump-pr.sh +220 -0
- openshell-0.1.8/scripts/core-sync/report-failure.sh +47 -0
- openshell-0.1.8/scripts/core-sync/update-drift-issue.sh +64 -0
- openshell-0.1.8/scripts/e2e/start-gateway.sh +132 -0
- openshell-0.1.8/scripts/e2e/stop-gateway.sh +53 -0
- openshell-0.1.8/scripts/fetch-core.sh +40 -0
- openshell-0.1.8/scripts/generate_python_proto.py +70 -0
- openshell-0.1.8/scripts/release/tag-release.sh +127 -0
- openshell-0.1.8/scripts/vendored-core-files.txt +8 -0
- openshell-0.1.8/scripts/verify-python-wheel.py +159 -0
- openshell-0.1.8/setup.cfg +4 -0
- openshell-0.1.8/src/openshell/__init__.py +69 -0
- openshell-0.1.8/src/openshell/_proto/__init__.py +15 -0
- openshell-0.1.8/src/openshell/_proto/credential_driver_pb2.py +69 -0
- openshell-0.1.8/src/openshell/_proto/credential_driver_pb2.pyi +141 -0
- openshell-0.1.8/src/openshell/_proto/credential_driver_pb2_grpc.py +292 -0
- openshell-0.1.8/src/openshell/_proto/credential_driver_pb2_grpc.pyi +121 -0
- openshell-0.1.8/src/openshell/_proto/datamodel_pb2.py +82 -0
- openshell-0.1.8/src/openshell/_proto/datamodel_pb2.pyi +144 -0
- openshell-0.1.8/src/openshell/_proto/datamodel_pb2_grpc.py +24 -0
- openshell-0.1.8/src/openshell/_proto/datamodel_pb2_grpc.pyi +22 -0
- openshell-0.1.8/src/openshell/_proto/extension_pb2.py +38 -0
- openshell-0.1.8/src/openshell/_proto/extension_pb2.pyi +29 -0
- openshell-0.1.8/src/openshell/_proto/extension_pb2_grpc.py +24 -0
- openshell-0.1.8/src/openshell/_proto/extension_pb2_grpc.pyi +22 -0
- openshell-0.1.8/src/openshell/_proto/openshell_pb2.py +910 -0
- openshell-0.1.8/src/openshell/_proto/openshell_pb2.pyi +3444 -0
- openshell-0.1.8/src/openshell/_proto/openshell_pb2_grpc.py +4014 -0
- openshell-0.1.8/src/openshell/_proto/openshell_pb2_grpc.pyi +1328 -0
- openshell-0.1.8/src/openshell/_proto/options_pb2.py +37 -0
- openshell-0.1.8/src/openshell/_proto/options_pb2.pyi +22 -0
- openshell-0.1.8/src/openshell/_proto/options_pb2_grpc.py +24 -0
- openshell-0.1.8/src/openshell/_proto/options_pb2_grpc.pyi +22 -0
- openshell-0.1.8/src/openshell/_proto/sandbox_pb2.py +145 -0
- openshell-0.1.8/src/openshell/_proto/sandbox_pb2.pyi +528 -0
- openshell-0.1.8/src/openshell/_proto/sandbox_pb2_grpc.py +24 -0
- openshell-0.1.8/src/openshell/_proto/sandbox_pb2_grpc.pyi +22 -0
- openshell-0.1.8/src/openshell/errors.py +149 -0
- openshell-0.1.8/src/openshell/mutations.py +33 -0
- openshell-0.1.8/src/openshell/providers.py +111 -0
- openshell-0.1.8/src/openshell/py.typed +0 -0
- openshell-0.1.8/src/openshell/sandbox.py +2689 -0
- openshell-0.1.8/src/openshell.egg-info/PKG-INFO +186 -0
- openshell-0.1.8/src/openshell.egg-info/SOURCES.txt +93 -0
- openshell-0.1.8/src/openshell.egg-info/dependency_links.txt +1 -0
- openshell-0.1.8/src/openshell.egg-info/requires.txt +5 -0
- openshell-0.1.8/src/openshell.egg-info/scm_file_list.json +91 -0
- openshell-0.1.8/src/openshell.egg-info/top_level.txt +1 -0
- openshell-0.1.8/tests/credential_driver_proto_test.py +58 -0
- openshell-0.1.8/tests/e2e/Dockerfile.workload +29 -0
- openshell-0.1.8/tests/e2e/conftest.py +92 -0
- openshell-0.1.8/tests/e2e/exec_admission_test.py +157 -0
- openshell-0.1.8/tests/e2e/sandbox_api_test.py +387 -0
- openshell-0.1.8/tests/e2e/sandbox_exec_python_test.py +42 -0
- openshell-0.1.8/tests/e2e/workspace_api_test.py +173 -0
- openshell-0.1.8/tests/errors_test.py +127 -0
- openshell-0.1.8/tests/fixtures/oauth-client-credentials.json +44 -0
- openshell-0.1.8/tests/fixtures/oauth-client-credentials.json.license +2 -0
- openshell-0.1.8/tests/generate_python_proto_test.py +59 -0
- openshell-0.1.8/tests/grpc_transport_test.py +101 -0
- openshell-0.1.8/tests/grpc_typing_test.py +81 -0
- openshell-0.1.8/tests/openshell_test.py +15 -0
- openshell-0.1.8/tests/providers_test.py +230 -0
- openshell-0.1.8/tests/sandbox_cleanup_test.py +286 -0
- openshell-0.1.8/tests/sandbox_test.py +3298 -0
- openshell-0.1.8/tests/wheel_verifier_test.py +157 -0
- openshell-0.1.8/uv.lock +663 -0
- openshell-0.0.0a0/MANIFEST.in +0 -4
- openshell-0.0.0a0/PKG-INFO +0 -13
- openshell-0.0.0a0/README.md +0 -3
- openshell-0.0.0a0/pyproject.toml +0 -15
- openshell-0.0.0a0/src/openshell/__init__.py +0 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Generated protobuf bindings (committed; see README). GitHub collapses them
|
|
2
|
+
# in diffs and leaves them out of language statistics. _proto/__init__.py is
|
|
3
|
+
# hand-written and stays visible.
|
|
4
|
+
src/openshell/_proto/*_pb2.py linguist-generated
|
|
5
|
+
src/openshell/_proto/*_pb2.pyi linguist-generated
|
|
6
|
+
src/openshell/_proto/*_pb2_grpc.py linguist-generated
|
|
7
|
+
src/openshell/_proto/*_pb2_grpc.pyi linguist-generated
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
name: Bug Report
|
|
4
|
+
description: Report unexpected behavior of the Python SDK with a clear user story and expected outcome.
|
|
5
|
+
type: Bug
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
## Bug Reports
|
|
11
|
+
|
|
12
|
+
Describe who encountered the bug, the problem it creates, why it matters, and the observable criteria for a fix. Please check the latest `openshell` release on PyPI and search existing issues for possible duplicates before filing.
|
|
13
|
+
|
|
14
|
+
Problems with the gateway, CLI, or sandboxes belong in [NVIDIA/OpenShell](https://github.com/NVIDIA/OpenShell/issues). Do not report security vulnerabilities here; follow [SECURITY.md](https://github.com/ai-openshell/sdk-python/blob/main/SECURITY.md) instead.
|
|
15
|
+
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: user-story
|
|
18
|
+
attributes:
|
|
19
|
+
label: User Story
|
|
20
|
+
description: Describe the specific use case and behavior you directly encountered or need.
|
|
21
|
+
placeholder: |
|
|
22
|
+
I use the OpenShell Python SDK for <specific use case>.
|
|
23
|
+
I directly encountered or need <specific behavior>.
|
|
24
|
+
This affects <outcome>.
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: problem
|
|
30
|
+
attributes:
|
|
31
|
+
label: Problem Statement
|
|
32
|
+
description: Summarize what is broken in the SDK's current behavior. Describe its consequences and current workarounds in Impact / Why This Matters.
|
|
33
|
+
placeholder: Describe the gap or failure in the SDK's current behavior and when it occurs.
|
|
34
|
+
validations:
|
|
35
|
+
required: true
|
|
36
|
+
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: impact
|
|
39
|
+
attributes:
|
|
40
|
+
label: Impact / Why This Matters
|
|
41
|
+
description: |
|
|
42
|
+
Explain how the bug affects users and what they must do to work around it today. Include evidence where available, but do not diagnose the cause or prescribe the fix.
|
|
43
|
+
placeholder: |
|
|
44
|
+
When this happens, users must...
|
|
45
|
+
This results in...
|
|
46
|
+
This matters because...
|
|
47
|
+
validations:
|
|
48
|
+
required: true
|
|
49
|
+
|
|
50
|
+
- type: textarea
|
|
51
|
+
id: acceptance-criteria
|
|
52
|
+
attributes:
|
|
53
|
+
label: Acceptance Criteria
|
|
54
|
+
description: List the specific, observable outcomes that would demonstrate the bug is fixed.
|
|
55
|
+
placeholder: |
|
|
56
|
+
- [ ] <observable outcome>
|
|
57
|
+
- [ ] <observable outcome>
|
|
58
|
+
validations:
|
|
59
|
+
required: true
|
|
60
|
+
|
|
61
|
+
- type: textarea
|
|
62
|
+
id: reproduction
|
|
63
|
+
attributes:
|
|
64
|
+
label: Reproduction Steps
|
|
65
|
+
description: Provide a minimal Python snippet against an OpenShell gateway, and what you expected instead.
|
|
66
|
+
placeholder: |
|
|
67
|
+
from openshell import Sandbox
|
|
68
|
+
|
|
69
|
+
with Sandbox(...) as sb:
|
|
70
|
+
...
|
|
71
|
+
render: python
|
|
72
|
+
validations:
|
|
73
|
+
required: true
|
|
74
|
+
|
|
75
|
+
- type: textarea
|
|
76
|
+
id: environment
|
|
77
|
+
attributes:
|
|
78
|
+
label: Environment
|
|
79
|
+
description: Include the SDK, Python, and gateway versions.
|
|
80
|
+
placeholder: |
|
|
81
|
+
- openshell (SDK): 0.x.x (output of `python -c "import openshell; print(openshell.__version__)"`)
|
|
82
|
+
- Python: 3.x.x
|
|
83
|
+
- OpenShell gateway: v0.x.x, deployment mode and compute driver
|
|
84
|
+
- OS: macOS 15.2 / Ubuntu 24.04 / Windows 11 + WSL2
|
|
85
|
+
validations:
|
|
86
|
+
required: true
|
|
87
|
+
|
|
88
|
+
- type: textarea
|
|
89
|
+
id: logs
|
|
90
|
+
attributes:
|
|
91
|
+
label: Logs
|
|
92
|
+
description: |
|
|
93
|
+
Include the smallest relevant traceback, error message, or log excerpt.
|
|
94
|
+
Redact credentials, API keys, tokens, and query parameters before pasting.
|
|
95
|
+
render: shell
|
|
96
|
+
validations:
|
|
97
|
+
required: false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
blank_issues_enabled: false
|
|
4
|
+
contact_links:
|
|
5
|
+
- name: Gateway, CLI, or sandbox problem?
|
|
6
|
+
url: https://github.com/NVIDIA/OpenShell/issues/new/choose
|
|
7
|
+
about: >
|
|
8
|
+
This repository is the Python SDK only. Report problems with the
|
|
9
|
+
OpenShell gateway, CLI, sandboxes, or the gRPC API in NVIDIA/OpenShell.
|
|
10
|
+
- name: Security vulnerability?
|
|
11
|
+
url: https://github.com/ai-openshell/sdk-python/blob/main/SECURITY.md
|
|
12
|
+
about: >
|
|
13
|
+
Do not report security vulnerabilities through GitHub issues. Follow
|
|
14
|
+
SECURITY.md and use the private reporting form.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
name: Feature Request
|
|
4
|
+
description: Propose an SDK feature with a user story and API design. Not a "please build this" request.
|
|
5
|
+
type: Feature
|
|
6
|
+
body:
|
|
7
|
+
- type: markdown
|
|
8
|
+
attributes:
|
|
9
|
+
value: |
|
|
10
|
+
## Design-First Feature Proposals
|
|
11
|
+
|
|
12
|
+
Describe who needs the feature, the problem it solves, why the current gap matters, the API you would like to use, and the observable criteria for success. Leave implementation choices to the people building the feature.
|
|
13
|
+
|
|
14
|
+
The SDK wraps the OpenShell gateway's API. A feature that needs a new gateway capability starts in [NVIDIA/OpenShell](https://github.com/NVIDIA/OpenShell/issues); link that issue here.
|
|
15
|
+
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: user-story
|
|
18
|
+
attributes:
|
|
19
|
+
label: User Story
|
|
20
|
+
description: Describe the specific use case and behavior you directly encountered or need.
|
|
21
|
+
placeholder: |
|
|
22
|
+
I use the OpenShell Python SDK for <specific use case>.
|
|
23
|
+
I directly encountered or need <specific behavior>.
|
|
24
|
+
This affects <outcome>.
|
|
25
|
+
validations:
|
|
26
|
+
required: true
|
|
27
|
+
|
|
28
|
+
- type: textarea
|
|
29
|
+
id: problem
|
|
30
|
+
attributes:
|
|
31
|
+
label: Problem Statement
|
|
32
|
+
description: Summarize the capability missing from the SDK today. Describe its consequences and current workarounds in Impact / Why This Matters.
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: impact
|
|
38
|
+
attributes:
|
|
39
|
+
label: Impact / Why This Matters
|
|
40
|
+
description: |
|
|
41
|
+
Explain what users must do today and why that is insufficient, for example calling `openshell._proto` stubs directly. Include concrete evidence where available, but do not prescribe the implementation.
|
|
42
|
+
placeholder: |
|
|
43
|
+
Without this feature, users must...
|
|
44
|
+
This results in...
|
|
45
|
+
This matters because...
|
|
46
|
+
validations:
|
|
47
|
+
required: true
|
|
48
|
+
|
|
49
|
+
- type: textarea
|
|
50
|
+
id: design
|
|
51
|
+
attributes:
|
|
52
|
+
label: Proposed API
|
|
53
|
+
description: |
|
|
54
|
+
How should this look to an SDK user? Show a notional Python example and describe the externally observable behavior.
|
|
55
|
+
render: python
|
|
56
|
+
validations:
|
|
57
|
+
required: true
|
|
58
|
+
|
|
59
|
+
- type: textarea
|
|
60
|
+
id: acceptance-criteria
|
|
61
|
+
attributes:
|
|
62
|
+
label: Acceptance Criteria
|
|
63
|
+
description: List specific, observable outcomes that would make this feature complete without prescribing how implementers achieve them.
|
|
64
|
+
placeholder: |
|
|
65
|
+
- [ ] <observable outcome>
|
|
66
|
+
- [ ] <observable outcome>
|
|
67
|
+
validations:
|
|
68
|
+
required: true
|
|
69
|
+
|
|
70
|
+
- type: textarea
|
|
71
|
+
id: alternatives
|
|
72
|
+
attributes:
|
|
73
|
+
label: Alternatives Considered
|
|
74
|
+
description: Explain what you tried with the current SDK, including the generated `openshell._proto` stubs, and why the proposal serves your use case better.
|
|
75
|
+
validations:
|
|
76
|
+
required: true
|
|
77
|
+
|
|
78
|
+
- type: checkboxes
|
|
79
|
+
id: checklist
|
|
80
|
+
attributes:
|
|
81
|
+
label: Checklist
|
|
82
|
+
options:
|
|
83
|
+
- label: I've reviewed existing issues and the README
|
|
84
|
+
required: true
|
|
85
|
+
- label: This is a design proposal, not a "please build this" request
|
|
86
|
+
required: true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
<!-- 1-3 sentences: what this PR does and why -->
|
|
3
|
+
|
|
4
|
+
## Related Issue
|
|
5
|
+
<!-- Closes #NNN. Small fixes, dependency updates and core bump PRs may skip the issue; say why instead. -->
|
|
6
|
+
|
|
7
|
+
## Changes
|
|
8
|
+
<!-- Bullet list of key changes. Call out changes to the public API (`openshell.__all__`) or to `openshell._proto`. -->
|
|
9
|
+
|
|
10
|
+
## Testing
|
|
11
|
+
<!-- Report the verification you ran for this change. -->
|
|
12
|
+
- [ ] `mise run ci` passes
|
|
13
|
+
- [ ] Unit tests added/updated (if applicable)
|
|
14
|
+
- [ ] E2E tests added/updated (if applicable)
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
- [ ] Follows [Conventional Commits](https://www.conventionalcommits.org/)
|
|
19
|
+
- [ ] Commits are signed off (DCO)
|
|
20
|
+
- [ ] README or CONTRIBUTING.md updated (if applicable)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
version: 2
|
|
4
|
+
updates:
|
|
5
|
+
- package-ecosystem: "uv"
|
|
6
|
+
directory: "/"
|
|
7
|
+
schedule:
|
|
8
|
+
interval: "weekly"
|
|
9
|
+
cooldown:
|
|
10
|
+
default-days: 7
|
|
11
|
+
groups:
|
|
12
|
+
python-minor-and-patch:
|
|
13
|
+
update-types: ["minor", "patch"]
|
|
14
|
+
|
|
15
|
+
- package-ecosystem: "github-actions"
|
|
16
|
+
directory: "/"
|
|
17
|
+
schedule:
|
|
18
|
+
interval: "daily"
|
|
19
|
+
cooldown:
|
|
20
|
+
default-days: 7
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
name: ci
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: ci-${{ github.ref }}
|
|
17
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
checks:
|
|
21
|
+
name: checks
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
timeout-minutes: 15
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
26
|
+
with:
|
|
27
|
+
persist-credentials: false
|
|
28
|
+
|
|
29
|
+
- uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c # v5.2.6
|
|
30
|
+
|
|
31
|
+
# fetch-core.sh reads proto/ and sdk/conformance from NVIDIA/OpenShell
|
|
32
|
+
# at the pinned ref (public, no credentials).
|
|
33
|
+
- name: Format, lint, typecheck, proto and fixture drift
|
|
34
|
+
run: mise run check
|
|
35
|
+
|
|
36
|
+
test:
|
|
37
|
+
name: test (${{ matrix.python }})
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
timeout-minutes: 15
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
# Keep in sync with requires-python and the classifiers in pyproject.toml.
|
|
44
|
+
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
45
|
+
env:
|
|
46
|
+
UV_PYTHON: ${{ matrix.python }}
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
49
|
+
with:
|
|
50
|
+
persist-credentials: false
|
|
51
|
+
|
|
52
|
+
- uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c # v5.2.6
|
|
53
|
+
|
|
54
|
+
- name: Unit tests
|
|
55
|
+
run: mise run test
|
|
56
|
+
|
|
57
|
+
build:
|
|
58
|
+
name: build
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
timeout-minutes: 15
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
63
|
+
with:
|
|
64
|
+
persist-credentials: false
|
|
65
|
+
# setuptools-scm reads the version from git history.
|
|
66
|
+
fetch-depth: 0
|
|
67
|
+
|
|
68
|
+
- uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c # v5.2.6
|
|
69
|
+
|
|
70
|
+
- name: Build, verify, and install the wheel and sdist
|
|
71
|
+
run: mise run build
|
|
72
|
+
|
|
73
|
+
e2e:
|
|
74
|
+
name: e2e
|
|
75
|
+
uses: ./.github/workflows/e2e.yml
|
|
76
|
+
|
|
77
|
+
# The one required status check. Its name matches ai-openshell/sdk-go, so
|
|
78
|
+
# rulesets can require `ci` in every SDK repository regardless of the jobs
|
|
79
|
+
# each one runs.
|
|
80
|
+
ci:
|
|
81
|
+
name: ci
|
|
82
|
+
if: always()
|
|
83
|
+
needs: [checks, test, build]
|
|
84
|
+
runs-on: ubuntu-latest
|
|
85
|
+
timeout-minutes: 5
|
|
86
|
+
steps:
|
|
87
|
+
- name: Require every job to succeed
|
|
88
|
+
env:
|
|
89
|
+
RESULTS: ${{ join(needs.*.result, ' ') }}
|
|
90
|
+
run: |
|
|
91
|
+
for result in $RESULTS; do
|
|
92
|
+
if [ "$result" != success ]; then
|
|
93
|
+
echo "::error::a required job finished with '$result' ($RESULTS)"
|
|
94
|
+
exit 1
|
|
95
|
+
fi
|
|
96
|
+
done
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
name: CodeQL
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
schedule:
|
|
10
|
+
- cron: "29 5 * * 1"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
concurrency:
|
|
17
|
+
group: codeql-${{ github.ref }}
|
|
18
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
analyze:
|
|
22
|
+
name: CodeQL (python)
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
timeout-minutes: 30
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
security-events: write
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
|
+
with:
|
|
31
|
+
persist-credentials: false
|
|
32
|
+
|
|
33
|
+
# Python needs no build. The generated bindings are left out.
|
|
34
|
+
- name: Initialize CodeQL
|
|
35
|
+
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
|
36
|
+
with:
|
|
37
|
+
languages: python
|
|
38
|
+
build-mode: none
|
|
39
|
+
config: |
|
|
40
|
+
paths-ignore:
|
|
41
|
+
- src/openshell/_proto
|
|
42
|
+
|
|
43
|
+
- name: Analyze
|
|
44
|
+
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
|
45
|
+
with:
|
|
46
|
+
category: /language:python
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
# Nightly comparison of core main with the pinned core tag; keeps the single
|
|
4
|
+
# "Core main drift" issue current (mise run core:drift).
|
|
5
|
+
name: core-drift
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "41 4 * * *"
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: core-drift
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
drift:
|
|
21
|
+
name: drift
|
|
22
|
+
# The bot secrets live in the sdk-bot environment, which only main can
|
|
23
|
+
# deploy to, so a pushed branch can't mint a bot token.
|
|
24
|
+
environment: sdk-bot
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
timeout-minutes: 20
|
|
27
|
+
steps:
|
|
28
|
+
- id: app-token
|
|
29
|
+
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
|
30
|
+
with:
|
|
31
|
+
client-id: ${{ secrets.SDK_BOT_CLIENT_ID }}
|
|
32
|
+
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
|
|
33
|
+
permission-issues: write
|
|
34
|
+
|
|
35
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
36
|
+
with:
|
|
37
|
+
persist-credentials: false
|
|
38
|
+
|
|
39
|
+
- uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c # v5.2.6
|
|
40
|
+
|
|
41
|
+
# Exit 1 with a report means drift; the issue records it. No report
|
|
42
|
+
# means the check itself broke, which the failure step records.
|
|
43
|
+
- name: Check drift against core main
|
|
44
|
+
run: |
|
|
45
|
+
mise run core:drift -- --out drift-report.md || true
|
|
46
|
+
test -s drift-report.md
|
|
47
|
+
cat drift-report.md >>"$GITHUB_STEP_SUMMARY"
|
|
48
|
+
|
|
49
|
+
- name: Update the drift issue
|
|
50
|
+
env:
|
|
51
|
+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
52
|
+
run: mise run core:drift-issue -- drift-report.md
|
|
53
|
+
|
|
54
|
+
- name: Report failure
|
|
55
|
+
if: failure()
|
|
56
|
+
env:
|
|
57
|
+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
58
|
+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
59
|
+
run: mise run core:report-failure -- core-drift "$RUN_URL"
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
# Opens one update proposal per new core release tag
|
|
4
|
+
# (mise run core:bump).
|
|
5
|
+
name: core-watch
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: "17 * * * *"
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
inputs:
|
|
12
|
+
tag:
|
|
13
|
+
description: Core tag to propose (vX.Y.Z or vX.Y.Z-pre.N); empty proposes every new tag
|
|
14
|
+
required: false
|
|
15
|
+
default: ""
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
concurrency:
|
|
21
|
+
group: core-watch
|
|
22
|
+
cancel-in-progress: false
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
watch:
|
|
26
|
+
name: watch
|
|
27
|
+
# The bot secrets live in the sdk-bot environment, which only main can
|
|
28
|
+
# deploy to, so a pushed branch can't mint a bot token.
|
|
29
|
+
environment: sdk-bot
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
timeout-minutes: 20
|
|
32
|
+
steps:
|
|
33
|
+
- id: app-token
|
|
34
|
+
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
|
35
|
+
with:
|
|
36
|
+
client-id: ${{ secrets.SDK_BOT_CLIENT_ID }}
|
|
37
|
+
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}
|
|
38
|
+
permission-contents: write
|
|
39
|
+
permission-pull-requests: write
|
|
40
|
+
permission-issues: write
|
|
41
|
+
|
|
42
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
43
|
+
with:
|
|
44
|
+
fetch-depth: 0
|
|
45
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
46
|
+
persist-credentials: true
|
|
47
|
+
|
|
48
|
+
- uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c # v5.2.6
|
|
49
|
+
|
|
50
|
+
- name: Set the bot identity
|
|
51
|
+
env:
|
|
52
|
+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
53
|
+
APP_SLUG: ${{ steps.app-token.outputs.app-slug }}
|
|
54
|
+
run: |
|
|
55
|
+
set -euo pipefail
|
|
56
|
+
id=$(gh api "users/${APP_SLUG}[bot]" --jq .id)
|
|
57
|
+
git config user.name "${APP_SLUG}[bot]"
|
|
58
|
+
git config user.email "${id}+${APP_SLUG}[bot]@users.noreply.github.com"
|
|
59
|
+
|
|
60
|
+
- name: Propose new core tags
|
|
61
|
+
env:
|
|
62
|
+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
63
|
+
INPUT_TAG: ${{ inputs.tag }}
|
|
64
|
+
run: |
|
|
65
|
+
set -euo pipefail
|
|
66
|
+
if [ -n "$INPUT_TAG" ]; then
|
|
67
|
+
tags=$INPUT_TAG
|
|
68
|
+
else
|
|
69
|
+
tags=$(mise run --quiet core:tags)
|
|
70
|
+
fi
|
|
71
|
+
if [ -z "$tags" ]; then
|
|
72
|
+
echo "No core tags newer than $(mise run --quiet core:version)."
|
|
73
|
+
exit 0
|
|
74
|
+
fi
|
|
75
|
+
for t in $tags; do
|
|
76
|
+
mise run core:bump -- "$t"
|
|
77
|
+
done
|
|
78
|
+
|
|
79
|
+
- name: Report failure
|
|
80
|
+
if: failure()
|
|
81
|
+
env:
|
|
82
|
+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
83
|
+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
84
|
+
run: mise run core:report-failure -- core-watch "$RUN_URL"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
# Runs the E2E suite against the published gateway of a core version, started
|
|
4
|
+
# from core's deploy/docker files (scripts/e2e/start-gateway.sh). Sandboxes
|
|
5
|
+
# run the image from tests/e2e/Dockerfile.workload, which has the same Python
|
|
6
|
+
# as the client, so exec_python can unpickle what the client pickled.
|
|
7
|
+
name: e2e
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
workflow_call:
|
|
11
|
+
inputs:
|
|
12
|
+
core-version:
|
|
13
|
+
description: Core version (default the pin, OPENSHELL_CORE_REF in mise.toml)
|
|
14
|
+
type: string
|
|
15
|
+
default: ""
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
inputs:
|
|
18
|
+
core-version:
|
|
19
|
+
description: Core version, for example v0.1.7 (default the pin, OPENSHELL_CORE_REF in mise.toml)
|
|
20
|
+
type: string
|
|
21
|
+
default: ""
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
contents: read
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
e2e:
|
|
28
|
+
name: e2e
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
timeout-minutes: 20
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
33
|
+
with:
|
|
34
|
+
persist-credentials: false
|
|
35
|
+
|
|
36
|
+
- uses: jdx/mise-action@f5be966e4a917d54244728e6a5fdcd1d93a35e6c # v5.2.6
|
|
37
|
+
|
|
38
|
+
- name: Build the sandbox image
|
|
39
|
+
run: mise run e2e:image
|
|
40
|
+
|
|
41
|
+
- name: Start the gateway
|
|
42
|
+
env:
|
|
43
|
+
CORE_VERSION: ${{ inputs.core-version }}
|
|
44
|
+
run: |
|
|
45
|
+
set -euo pipefail
|
|
46
|
+
version=${CORE_VERSION:-$(mise run -q core:version)}
|
|
47
|
+
echo "Core version: $version" >>"$GITHUB_STEP_SUMMARY"
|
|
48
|
+
scripts/e2e/start-gateway.sh "$version" --default-image openshell/e2e-python:dev
|
|
49
|
+
|
|
50
|
+
- name: Run the E2E suite
|
|
51
|
+
env:
|
|
52
|
+
OPENSHELL_GATEWAY: e2e
|
|
53
|
+
run: mise run e2e
|
|
54
|
+
|
|
55
|
+
- name: Stop the gateway
|
|
56
|
+
if: always()
|
|
57
|
+
run: scripts/e2e/stop-gateway.sh
|
|
58
|
+
|
|
59
|
+
- name: Upload the gateway log
|
|
60
|
+
if: failure()
|
|
61
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
62
|
+
with:
|
|
63
|
+
name: gateway-log
|
|
64
|
+
path: ${{ runner.temp }}/openshell-e2e/gateway.log
|
|
65
|
+
if-no-files-found: ignore
|