Thomas Anderson
de53b906e8
Add ports into pipeline backend step model ( #2656 )
...
Closes #2655 .
[Pipeline](https://woodpecker-ci.org/docs/next/usage/services#complete-pipeline-example ):
```yaml
services:
database:
image: mysql
environment:
- MYSQL_DATABASE=test
- MYSQL_ROOT_PASSWORD=example
ports:
- 3306
steps:
get-version:
image: ubuntu
commands:
- ( apt update && apt dist-upgrade -y && apt install -y mysql-client 2>&1 )> /dev/null
- sleep 60s # need to wait for mysql-server init
- echo 'SHOW VARIABLES LIKE "version"' | mysql -uroot -hdatabase test -pexample
```
Service:
```yaml
apiVersion: v1
kind: Service
metadata:
name: wp-01hdq6gbkw1mn6k1655fs3rntf-0-services-0
namespace: woodpecker-runtime
...
selfLink: >-
/api/v1/namespaces/woodpecker-runtime/services/wp-01hdq6gbkw1mn6k1655fs3rntf-0-services-0
status:
loadBalancer: {}
spec:
ports:
- protocol: TCP
port: 3306
targetPort: 3306
selector:
step: database
clusterIP: 10.43.180.120
clusterIPs:
- 10.43.180.120
type: ClusterIP
sessionAffinity: None
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
internalTrafficPolicy: Cluster
```
2023-11-02 04:12:41 +01:00
Thomas Anderson
3620c84da4
Unregister stateless agents from server on termination ( #2606 )
...
Closes #2027
---------
Co-authored-by: 6543 <6543@obermui.de>
2023-11-02 01:53:47 +02:00
6543
ebe0307c6b
Let the backend engine report the current platform ( #2688 )
...
if you run woodpecker-agent on windows and connect it to an docker
daemon, there could be two different platforms possible, as you can
switch from linux to windows mode and visa versa
---
*Sponsored by Kithara Software GmbH*
2023-11-01 15:38:37 +01:00
Anbraten
4198c447fb
Destroy steps after they are done ( #2681 )
...
Co-authored-by: 6543 <m.huber@kithara.com>
2023-11-01 09:35:11 +01:00
qwerty287
e74115027b
Add some tests ( #2652 )
...
and some cleanups
2023-10-28 13:37:54 +02:00
qwerty287
46273e54d8
Require Go 1.21 ( #2553 )
...
Main change are the new `maps` and `slices` stdlib packages so we can
replace `golang.org/x/exp`.
2023-10-09 09:11:08 +02:00
Kleber Rocha
61b5672051
Add option to configure tolerations in kubernetes backend ( #2249 )
...
This code add a feature to support tolerations in Kubernetes Backend
---------
Signed-off-by: Kleber Rocha <klinux@gmail.com>
2023-08-22 22:34:59 +02:00
qwerty287
8cdac56d8f
Check for correct license header ( #2137 )
2023-08-10 11:06:00 +02:00
6543
d253f8cc30
Make sure we dont have hidden options for backend and pipeline compiler ( #2123 )
...
move options based on **os.Getenv** into flags
---------
*Sponsored by Kithara Software GmbH*
2023-08-07 21:13:26 +02:00
6543
a83b0fcfd3
Drop deprecated built-in environment variables ( #2048 )
...
Drop:
- `CI_BUILD_*`
- `CI_PREV_BUILD_*`
- `CI_JOB_*`
- `*_LINK`
- `CI_SYSTEM_ARCH`
- `CI_REPO_REMOTE`
2023-07-28 14:58:20 +02:00
6543
3cd78c9409
Refactor agent ( #2021 )
...
- code cleanup
- init backend engine only once
- pass a taskUUID to the backend
---
*Sponsored by Kithara Software GmbH*
2023-07-20 20:39:20 +02:00
Thomas Anderson
1875e2a416
Fix platform to node-selector mapping for k8s ( #1963 )
...
Closes #1955
2023-07-09 20:22:50 +03:00
Thomas Anderson
cef135eba5
Do not set Pod's Image pull policy if not explicitly set ( #1914 )
2023-07-07 20:02:13 +02:00
Thomas Anderson
d46b91a94c
Refactored K8s Pod node selector ( #1909 )
...
- using existing map instead of an array
- applying var name convention
- using arch constant
2023-07-07 07:46:48 +02:00
Ovidiu Calbajos
609ba481b5
Support for k8s serviceAccount and nodeSelector ( #1842 )
...
Add the possiblity to specify the Kubernetes serviceAccount and/or
nodeSelector to be used on individual steps for Kubernetes executor
2023-06-12 16:00:59 +02:00
Stephen Muth
2941e508b3
Allow setting resources for kubernetes on a per-step basis ( #1767 )
...
This add a simple implementation of requests/limits for individual
steps. There is no validation of what the resource actually is beyond
checking that it can successfully be converted to a Quantity, so it can
be used for things other than just memory/CPU.
close #1809
2023-06-04 00:50:08 +02:00
Patrick Schratz
d13a8744ce
Add nodeSelector
using platform for kubernetes ( #1737 )
...
Co-authored-by: Anbraten <anton@ju60.de>
2023-05-18 11:21:20 +02:00
Neil Hanlon
a95a5b43bf
fix(backend/kubernetes): Ensure valid naming of name field ( #1661 )
...
- Kubernetes v1.26 on VKE causes error when creating persistent volume
claim because of uppercase characters in name field
This patch is trivial just in order to get it working - happy to
implement differently.
The error in question:
```
The PersistentVolumeClaim "wp-01G1131R63FWBSPMA4ZAZTKLE-0-clone-0" is invalid: metadata.name: Invalid value: "wp-01G1131R63FWBSPMA4ZAZTKLE-0-clone-0": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
```
2023-03-21 20:00:45 +01:00
Lauris BH
46452fbd84
Update Go dependencies and minimal Go version to 1.20 ( #1650 )
...
Signed-off-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
2023-03-21 00:48:15 +01:00
qwerty287
f582ad3159
Various enhancements in configuration ( #1645 )
...
- backends: move to cli flags instead of os.Getenv
- ssh: support 2fa with key and password
- allow to set grpc jwt secret (solves todo)
- allow to set default and max timeout (solves todo)
Closes https://github.com/woodpecker-ci/woodpecker/issues/896
Closes https://github.com/woodpecker-ci/woodpecker/issues/1131
2023-03-19 20:24:43 +01:00
Stephen Muth
be4ce2e02d
Ensure the SharedInformerFactory closes eventually ( #1585 )
...
Otherwise it will continue to collect events in the background, consuming memory that can't be GC'd.
2023-02-16 00:54:33 +01:00
6543
5c617accd8
kubernetes ignore labels and annotations if not set ( #1528 )
...
close #1527
regression of #1510
2023-01-04 19:51:21 +02:00
Stephen Muth
1816f6c715
Allow adding additional labels/annotations to kubernetes worker pods ( #1510 )
...
Example agent environment configuration using the new value:
```yaml
- env:
- name: WOODPECKER_BACKEND
value: kubernetes
- name: WOODPECKER_BACKEND_K8S_NAMESPACE
value: default
- name: WOODPECKER_BACKEND_K8S_POD_LABELS
value: '{"sidecar.istio.io/inject":"false"}'
```
2022-12-31 01:37:09 +01:00
6543
b15ca52a63
Move constrain to only have a single command in backend to run to dedicated backends ( #1032 )
...
at the moment we compile a script that we can pipe in as single command
this is because of the constrains the docker backend gives us.
so we move it into the docker backend and eventually get rid of it altogether
2022-10-31 00:26:49 +01:00
Anbraten
3b0263442a
Adding initial version of Kubernetes backend ( #552 )
...
Co-authored-by: laszlocph <laszlo@laszlo.cloud>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Rynoxx <rynoxx@grid-servers.net>
2022-09-05 06:01:14 +02:00
6543
e072e4cce7
Fix pipeline backend autodetect ( #545 )
...
* refactor:
- rename IsAvivable -> IsAvailable
- drop depricated Kill
- make sure backends implement interface
- rename backend struct for ide (better info)
* docker backend fix autodetect
2021-11-27 02:29:14 +01:00
Anbraten
c1a8884d62
Add backend selection for agent ( #463 )
...
- add backend selection option
- by default it will auto-detect a backend
2021-11-26 03:34:48 +01:00
Jacob Floyd
e34daae0cf
Move cncd/pipeline/pipeline/ to pipeline/ ( #347 )
...
* Refactor: move cncd/pipeline/ to pipeline/
* Refactor: move pipeline/pipeline/ to pipeline/
2021-09-24 13:18:34 +02:00