cloudsnorkel.cdk-github-runners 0.13.3__py3-none-any.whl → 0.14.15__py3-none-any.whl
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.
- cloudsnorkel/cdk_github_runners/__init__.py +710 -58
- cloudsnorkel/cdk_github_runners/_jsii/__init__.py +18 -3
- cloudsnorkel/cdk_github_runners/_jsii/cdk-github-runners@0.14.15.jsii.tgz +0 -0
- {cloudsnorkel.cdk_github_runners-0.13.3.dist-info → cloudsnorkel_cdk_github_runners-0.14.15.dist-info}/METADATA +84 -20
- cloudsnorkel_cdk_github_runners-0.14.15.dist-info/RECORD +9 -0
- {cloudsnorkel.cdk_github_runners-0.13.3.dist-info → cloudsnorkel_cdk_github_runners-0.14.15.dist-info}/WHEEL +1 -1
- cloudsnorkel/cdk_github_runners/_jsii/cdk-github-runners@0.13.3.jsii.tgz +0 -0
- cloudsnorkel.cdk_github_runners-0.13.3.dist-info/RECORD +0 -9
- {cloudsnorkel.cdk_github_runners-0.13.3.dist-info → cloudsnorkel_cdk_github_runners-0.14.15.dist-info}/LICENSE +0 -0
- {cloudsnorkel.cdk_github_runners-0.13.3.dist-info → cloudsnorkel_cdk_github_runners-0.14.15.dist-info}/top_level.txt +0 -0
|
@@ -11,16 +11,31 @@ import jsii
|
|
|
11
11
|
import publication
|
|
12
12
|
import typing_extensions
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
import typeguard
|
|
15
|
+
from importlib.metadata import version as _metadata_package_version
|
|
16
|
+
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
17
|
+
|
|
18
|
+
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
19
|
+
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
20
|
+
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
21
|
+
else:
|
|
22
|
+
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
23
|
+
pass
|
|
24
|
+
else:
|
|
25
|
+
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
26
|
+
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
27
|
+
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
28
|
+
else:
|
|
29
|
+
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
15
30
|
|
|
16
31
|
import aws_cdk._jsii
|
|
17
32
|
import constructs._jsii
|
|
18
33
|
|
|
19
34
|
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
20
35
|
"@cloudsnorkel/cdk-github-runners",
|
|
21
|
-
"0.
|
|
36
|
+
"0.14.15",
|
|
22
37
|
__name__[0:-6],
|
|
23
|
-
"cdk-github-runners@0.
|
|
38
|
+
"cdk-github-runners@0.14.15.jsii.tgz",
|
|
24
39
|
)
|
|
25
40
|
|
|
26
41
|
__all__ = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloudsnorkel.cdk-github-runners
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: CDK construct to create GitHub Actions self-hosted runners.
|
|
3
|
+
Version: 0.14.15
|
|
4
|
+
Summary: CDK construct to create GitHub Actions self-hosted runners. Creates ephemeral runners on demand. Easy to deploy and highly customizable.
|
|
5
5
|
Home-page: https://github.com/CloudSnorkel/cdk-github-runners.git
|
|
6
6
|
Author: Amir Szekely<amir@cloudsnorkel.com>
|
|
7
7
|
License: Apache-2.0
|
|
@@ -10,21 +10,20 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: JavaScript
|
|
12
12
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
16
|
Classifier: Typing :: Typed
|
|
18
17
|
Classifier: Development Status :: 4 - Beta
|
|
19
18
|
Classifier: License :: OSI Approved
|
|
20
|
-
Requires-Python: ~=3.
|
|
19
|
+
Requires-Python: ~=3.9
|
|
21
20
|
Description-Content-Type: text/markdown
|
|
22
21
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: aws-cdk-lib <3.0.0,>=2.
|
|
22
|
+
Requires-Dist: aws-cdk-lib <3.0.0,>=2.155.0
|
|
24
23
|
Requires-Dist: constructs <11.0.0,>=10.0.5
|
|
25
|
-
Requires-Dist: jsii <2.0.0,>=1.
|
|
24
|
+
Requires-Dist: jsii <2.0.0,>=1.120.0
|
|
26
25
|
Requires-Dist: publication >=0.0.3
|
|
27
|
-
Requires-Dist: typeguard
|
|
26
|
+
Requires-Dist: typeguard ==2.13.3
|
|
28
27
|
|
|
29
28
|
# GitHub Self-Hosted Runners CDK Constructs
|
|
30
29
|
|
|
@@ -38,17 +37,17 @@ Requires-Dist: typeguard ~=2.13.3
|
|
|
38
37
|
|
|
39
38
|
Use this CDK construct to create ephemeral [self-hosted GitHub runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) on-demand inside your AWS account.
|
|
40
39
|
|
|
41
|
-
* Easy to configure GitHub integration with a web-based interface
|
|
42
|
-
* Customizable runners with decent defaults
|
|
43
|
-
* Multiple runner configurations controlled by labels
|
|
44
|
-
* Everything fully hosted in your account
|
|
45
|
-
* Automatically updated build environment with latest runner version
|
|
40
|
+
* 🧩 Easy to configure GitHub integration with a web-based interface
|
|
41
|
+
* 🧠 Customizable runners with decent defaults
|
|
42
|
+
* 🏃🏻 Multiple runner configurations controlled by labels
|
|
43
|
+
* 🔐 Everything fully hosted in your account
|
|
44
|
+
* 🔃 Automatically updated build environment with latest runner version
|
|
46
45
|
|
|
47
46
|
Self-hosted runners in AWS are useful when:
|
|
48
47
|
|
|
49
48
|
* You need easy access to internal resources in your actions
|
|
50
49
|
* You want to pre-install some software for your actions
|
|
51
|
-
* You want to provide some basic AWS API access (but [aws-actions/configure-aws-credentials](https://github.com/marketplace/actions/configure-aws-credentials-for-github-actions) has more security controls)
|
|
50
|
+
* You want to provide some basic AWS API access (but [aws-actions/configure-aws-credentials](https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions) has more security controls)
|
|
52
51
|
* You are using GitHub Enterprise Server
|
|
53
52
|
|
|
54
53
|
Ephemeral (or on-demand) runners are the [recommended way by GitHub](https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling) for auto-scaling, and they make sure all jobs run with a clean image. Runners are started on-demand. You don't pay unless a job is running.
|
|
@@ -98,9 +97,14 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
98
97
|
### Use
|
|
99
98
|
|
|
100
99
|
```python
|
|
100
|
+
from aws_cdk import App, Stack
|
|
101
101
|
from cloudsnorkel.cdk_github_runners import GitHubRunners
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
app = App()
|
|
104
|
+
stack = Stack(app, "github-runners")
|
|
105
|
+
GitHubRunners(stack, "runners")
|
|
106
|
+
|
|
107
|
+
app.synth()
|
|
104
108
|
```
|
|
105
109
|
|
|
106
110
|
</details>
|
|
@@ -117,9 +121,14 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
117
121
|
### Use
|
|
118
122
|
|
|
119
123
|
```python
|
|
124
|
+
import { App, Stack } from 'aws-cdk-lib';
|
|
120
125
|
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners';
|
|
121
126
|
|
|
122
|
-
new
|
|
127
|
+
const app = new App();
|
|
128
|
+
const stack = new Stack(app, 'github-runners');
|
|
129
|
+
new GitHubRunners(stack, 'runners');
|
|
130
|
+
|
|
131
|
+
app.synth();
|
|
123
132
|
```
|
|
124
133
|
|
|
125
134
|
</details>
|
|
@@ -139,9 +148,19 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
139
148
|
### Use
|
|
140
149
|
|
|
141
150
|
```java
|
|
151
|
+
import software.amazon.awscdk.App;
|
|
152
|
+
import software.amazon.awscdk.Stack;
|
|
142
153
|
import com.cloudsnorkel.cdk.github.runners.GitHubRunners;
|
|
143
154
|
|
|
144
|
-
|
|
155
|
+
public class Example {
|
|
156
|
+
public static void main(String[] args){
|
|
157
|
+
App app = new App();
|
|
158
|
+
Stack stack = new Stack(app, "github-runners");
|
|
159
|
+
GitHubRunners.Builder.create(stack, "runners").build();
|
|
160
|
+
|
|
161
|
+
app.synth();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
145
164
|
```
|
|
146
165
|
|
|
147
166
|
</details>
|
|
@@ -158,9 +177,21 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
158
177
|
### Use
|
|
159
178
|
|
|
160
179
|
```go
|
|
161
|
-
|
|
180
|
+
package main
|
|
181
|
+
|
|
182
|
+
import (
|
|
183
|
+
"github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
|
|
184
|
+
"github.com/aws/aws-cdk-go/awscdk/v2"
|
|
185
|
+
"github.com/aws/jsii-runtime-go"
|
|
186
|
+
)
|
|
162
187
|
|
|
163
|
-
|
|
188
|
+
func main() {
|
|
189
|
+
app := awscdk.NewApp(nil)
|
|
190
|
+
stack := awscdk.NewStack(app, jsii.String("github-runners"), &awscdk.StackProps{})
|
|
191
|
+
cloudsnorkelcdkgithubrunners.NewGitHubRunners(stack, jsii.String("runners"), &cloudsnorkelcdkgithubrunners.GitHubRunnersProps{})
|
|
192
|
+
|
|
193
|
+
app.Synth(nil)
|
|
194
|
+
}
|
|
164
195
|
```
|
|
165
196
|
|
|
166
197
|
</details>
|
|
@@ -177,9 +208,22 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
177
208
|
### Use
|
|
178
209
|
|
|
179
210
|
```csharp
|
|
211
|
+
using Amazon.CDK;
|
|
180
212
|
using CloudSnorkel;
|
|
181
213
|
|
|
182
|
-
|
|
214
|
+
namespace Example
|
|
215
|
+
{
|
|
216
|
+
sealed class Program
|
|
217
|
+
{
|
|
218
|
+
public static void Main(string[] args)
|
|
219
|
+
{
|
|
220
|
+
var app = new App();
|
|
221
|
+
var stack = new Stack(app, "github-runners");
|
|
222
|
+
new GitHubRunners(stack, "runners");
|
|
223
|
+
app.Synth();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
183
227
|
```
|
|
184
228
|
|
|
185
229
|
</details>
|
|
@@ -198,7 +242,7 @@ You can also create your own provider by implementing `IRunnerProvider`.
|
|
|
198
242
|
5. Execute the status command (you may need to specify `--profile` too) and open the resulting `status.json` file
|
|
199
243
|
6. Open the URL in `github.setup.url` from `status.json` or [manually setup GitHub](SETUP_GITHUB.md) integration as an app or with personal access token
|
|
200
244
|
7. Run status command again to confirm `github.auth.status` and `github.webhook.status` are OK
|
|
201
|
-
8. Trigger a GitHub action that has a `self-hosted` label with `runs-on: [self-hosted,
|
|
245
|
+
8. Trigger a GitHub action that has a `self-hosted` label with `runs-on: [self-hosted, codebuild]` (or non-default labels you set in step 2)
|
|
202
246
|
9. If the action is not successful, see [troubleshooting](#Troubleshooting)
|
|
203
247
|
|
|
204
248
|
[](https://youtu.be/wlyv_3V8lIw)
|
|
@@ -306,6 +350,12 @@ new GitHubRunners(this, 'runners', {
|
|
|
306
350
|
});
|
|
307
351
|
```
|
|
308
352
|
|
|
353
|
+
## Examples
|
|
354
|
+
|
|
355
|
+
Beyond the code snippets above, the fullest example available is the [integration test](test/default.integ.ts).
|
|
356
|
+
|
|
357
|
+
If you have more to share, please open a PR adding them to the `examples` folder.
|
|
358
|
+
|
|
309
359
|
## Architecture
|
|
310
360
|
|
|
311
361
|

|
|
@@ -350,6 +400,20 @@ Other useful metrics to track:
|
|
|
350
400
|
1. Use `GitHubRunners.metricJobCompleted()` to get a metric for the number of completed jobs broken down by labels and job success.
|
|
351
401
|
2. Use `GitHubRunners.metricTime()` to get a metric for the total time a runner is running. This includes the overhead of starting the runner.
|
|
352
402
|
|
|
403
|
+
## Contributing
|
|
404
|
+
|
|
405
|
+
If you use and love this project, please consider contributing.
|
|
406
|
+
|
|
407
|
+
1. 🪳 If you see something, say something. [Issues](https://github.com/CloudSnorkel/cdk-github-runners/issues) help improve the quality of the project.
|
|
408
|
+
|
|
409
|
+
* Include relevant logs and package versions for bugs.
|
|
410
|
+
* When possible, describe the use-case behind feature requests.
|
|
411
|
+
2. 🛠️ [Pull requests](https://github.com/CloudSnorkel/cdk-github-runners/pulls) are welcome.
|
|
412
|
+
|
|
413
|
+
* Run `npm run build` before submitting to make sure all tests pass.
|
|
414
|
+
* Allow edits from maintainers so small adjustments can be made easily.
|
|
415
|
+
3. 💵 Consider [sponsoring](https://github.com/sponsors/CloudSnorkel) the project to show your support and optionally get your name listed below.
|
|
416
|
+
|
|
353
417
|
## Other Options
|
|
354
418
|
|
|
355
419
|
1. [philips-labs/terraform-aws-github-runner](https://github.com/philips-labs/terraform-aws-github-runner) if you're using Terraform
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cloudsnorkel/cdk_github_runners/__init__.py,sha256=lt48SFAM2lBqZtBrmeMBqVC_mVUWIRnGj2a9ImPZFok,644017
|
|
2
|
+
cloudsnorkel/cdk_github_runners/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
+
cloudsnorkel/cdk_github_runners/_jsii/__init__.py,sha256=GgTHeJjfy3W99X2Xpd9vCouQShyHTb7SXdiu-ujkonY,1478
|
|
4
|
+
cloudsnorkel/cdk_github_runners/_jsii/cdk-github-runners@0.14.15.jsii.tgz,sha256=c5nXenc2JZsl0J6m4l5nawQs3WxhGMi2SO91I6vyjgU,1629062
|
|
5
|
+
cloudsnorkel_cdk_github_runners-0.14.15.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
6
|
+
cloudsnorkel_cdk_github_runners-0.14.15.dist-info/METADATA,sha256=OTf79TdAl1kCMejyzSCbvJlAFp-RnIXJeV10C0o6Opg,17808
|
|
7
|
+
cloudsnorkel_cdk_github_runners-0.14.15.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
|
8
|
+
cloudsnorkel_cdk_github_runners-0.14.15.dist-info/top_level.txt,sha256=6vUrT-dcGOiRMT4Q6gEQPznoyS7nHOJ269MHpo4DEd8,13
|
|
9
|
+
cloudsnorkel_cdk_github_runners-0.14.15.dist-info/RECORD,,
|
|
Binary file
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
cloudsnorkel/cdk_github_runners/__init__.py,sha256=ujO9tqWBYZP7a3dgjsmy6QWYBY5bGMH5WLmRA9pDg8Q,602385
|
|
2
|
-
cloudsnorkel/cdk_github_runners/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
-
cloudsnorkel/cdk_github_runners/_jsii/__init__.py,sha256=t78xFxuof8Y48ayy0qCw_sFWZu6hYERk-ZBOVQVJIFY,508
|
|
4
|
-
cloudsnorkel/cdk_github_runners/_jsii/cdk-github-runners@0.13.3.jsii.tgz,sha256=VCbnCYwMGts_SVXHu30tcZYTIOoFDX33nN9mn48s_KI,1437512
|
|
5
|
-
cloudsnorkel.cdk_github_runners-0.13.3.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
6
|
-
cloudsnorkel.cdk_github_runners-0.13.3.dist-info/METADATA,sha256=nYlr8Oyr44ZvmnRechkAkgHrsXm9Jzs5QfRhRV4pF0s,15681
|
|
7
|
-
cloudsnorkel.cdk_github_runners-0.13.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
8
|
-
cloudsnorkel.cdk_github_runners-0.13.3.dist-info/top_level.txt,sha256=6vUrT-dcGOiRMT4Q6gEQPznoyS7nHOJ269MHpo4DEd8,13
|
|
9
|
-
cloudsnorkel.cdk_github_runners-0.13.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|