2019-08-10 21:29:25 +00:00
// This file contains the logic for building our CI for Drone. The idea here is
// that we create a pipeline for all of the major tasks we need to perform
// (e.g. builds, E2E testing, conformance testing, releases). Each pipeline
// after the default builds on a previous pipeline.
2019-09-06 22:37:37 -05:00
// Generate with `drone jsonnet --source ./hack/drone.jsonnet --stream --format`
2020-04-07 22:49:12 +03:00
// Sign with `drone sign talos-systems/talos --save`
2019-08-10 21:29:25 +00:00
2019-08-02 16:08:24 -05:00
local build_container = ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ;
2019-12-23 10:36:14 -08:00
2019-08-10 21:29:25 +00:00
local volumes = {
dockersock : {
pipeline : {
2019-08-02 16:08:24 -05:00
name : ' d o c k e r s o c k ' ,
2019-08-10 21:29:25 +00:00
temp : { } ,
} ,
step : {
name : $ . dockersock . pipeline . name ,
2019-08-02 16:08:24 -05:00
path : ' / v a r / r u n ' ,
2019-08-10 21:29:25 +00:00
} ,
2019-08-09 03:45:13 +00:00
} ,
2019-08-10 21:29:25 +00:00
2020-07-27 23:24:07 +03:00
outerdockersock : {
pipeline : {
name : ' o u t e r d o c k e r s o c k ' ,
host : {
path : ' / v a r / c i - d o c k e r '
} ,
} ,
step : {
name : $ . outerdockersock . pipeline . name ,
path : ' / v a r / o u t e r - r u n ' ,
} ,
} ,
2019-12-23 10:36:14 -08:00
docker : {
pipeline : {
name : ' d o c k e r ' ,
temp : { } ,
} ,
step : {
name : $ . docker . pipeline . name ,
path : ' / r o o t / . d o c k e r / b u i l d x ' ,
} ,
} ,
kube : {
pipeline : {
name : ' k u b e ' ,
temp : { } ,
} ,
step : {
name : $ . kube . pipeline . name ,
path : ' / r o o t / . k u b e ' ,
} ,
} ,
2019-08-10 21:29:25 +00:00
dev : {
pipeline : {
2019-08-02 16:08:24 -05:00
name : ' d e v ' ,
2019-08-10 21:29:25 +00:00
host : {
2019-08-02 16:08:24 -05:00
path : ' / d e v ' ,
2019-08-10 21:29:25 +00:00
} ,
} ,
step : {
name : $ . dev . pipeline . name ,
2019-08-02 16:08:24 -05:00
path : ' / d e v ' ,
2019-08-10 21:29:25 +00:00
} ,
2019-08-09 03:45:13 +00:00
} ,
2019-08-10 21:29:25 +00:00
2020-06-29 21:36:51 +03:00
tmp : {
pipeline : {
name : ' t m p ' ,
temp : { } ,
} ,
step : {
name : $ . tmp . pipeline . name ,
path : ' / t m p ' ,
} ,
} ,
2020-07-23 11:21:42 -07:00
// cache: {
// pipeline: {
// name: 'cache',
// host: {
// path: '/tmp',
// },
// },
// step: {
// name: $.cache.pipeline.name,
// path: '/tmp/cache',
// },
// },
2019-08-10 21:29:25 +00:00
ForStep ( ) : [
self . dockersock . step ,
2020-07-27 23:24:07 +03:00
self . outerdockersock . step ,
2019-12-23 10:36:14 -08:00
self . docker . step ,
self . kube . step ,
2019-08-10 21:29:25 +00:00
self . dev . step ,
2020-07-30 00:36:58 +03:00
self . tmp . step ,
2020-07-23 11:21:42 -07:00
// self.cache.step,
2019-08-10 21:29:25 +00:00
] ,
ForPipeline ( ) : [
self . dockersock . pipeline ,
2020-07-27 23:24:07 +03:00
self . outerdockersock . pipeline ,
2019-12-23 10:36:14 -08:00
self . docker . pipeline ,
self . kube . pipeline ,
2019-08-10 21:29:25 +00:00
self . dev . pipeline ,
2020-06-29 21:36:51 +03:00
self . tmp . pipeline ,
2020-07-23 11:21:42 -07:00
// self.cache.pipeline,
2019-08-10 21:29:25 +00:00
] ,
} ;
2019-08-09 03:45:13 +00:00
2019-08-10 21:29:25 +00:00
// This provides the docker service.
2019-08-09 03:45:13 +00:00
local docker = {
2019-08-02 16:08:24 -05:00
name : ' d o c k e r ' ,
image : ' d o c k e r : 1 9 . 0 3 - d i n d ' ,
entrypoint : [ ' d o c k e r d ' ] ,
2019-08-09 03:45:13 +00:00
privileged : true ,
command : [
2019-08-02 16:08:24 -05:00
' - - d n s = 8 . 8 . 8 . 8 ' ,
' - - d n s = 8 . 8 . 4 . 4 ' ,
2020-01-21 19:37:12 -08:00
' - - m t u = 1 5 0 0 ' ,
2019-08-02 16:08:24 -05:00
' - - l o g - l e v e l = e r r o r ' ,
2020-07-23 11:21:42 -07:00
' - - i n s e c u r e - r e g i s t r y = 1 2 7 . 0 . 0 . 1 : 5 0 0 0 ' ,
2019-12-27 18:12:04 +00:00
] ,
2020-07-23 11:21:42 -07:00
// Set resource requests to ensure that only one build can be performed at a
// time. We set it on the service so that we get the scheduling restricitions
// while still allowing parallel steps.
resources : {
requests : {
cpu : 24000 ,
memory : ' 4 8 G i B ' ,
} ,
} ,
2019-08-10 21:29:25 +00:00
volumes : volumes . ForStep ( ) ,
2019-08-09 03:45:13 +00:00
} ;
2019-12-24 09:28:58 -08:00
// Sets up the CI environment
local setup_ci = {
name : ' s e t u p - c i ' ,
2019-12-23 10:36:14 -08:00
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
2019-08-09 03:45:13 +00:00
privileged : true ,
2019-12-23 10:36:14 -08:00
commands : [
2020-07-23 11:21:42 -07:00
' s l e e p 5 ' , // Give docker enough time to start.
2019-12-24 09:28:58 -08:00
' a p k a d d c o r e u t i l s ' ,
2020-07-27 23:24:07 +03:00
' d o c k e r b u i l d x c r e a t e - - d r i v e r d o c k e r - c o n t a i n e r - - p l a t f o r m l i n u x / a m d 6 4 - - b u i l d k i t d - f l a g s " - - a l l o w - i n s e c u r e - e n t i t l e m e n t s e c u r i t y . i n s e c u r e " - - n a m e l o c a l - - u s e u n i x : / / / v a r / o u t e r - r u n / d o c k e r . s o c k ' ,
2020-01-23 20:52:02 -08:00
' d o c k e r b u i l d x i n s p e c t - - b o o t s t r a p ' ,
2020-07-23 11:21:42 -07:00
' d o c k e r r u n - d - p 5 0 0 0 : 5 0 0 0 - - r e s t a r t = a l w a y s - - n a m e r e g i s t r y r e g i s t r y : 2 ' ,
2020-01-23 20:52:02 -08:00
' m a k e . / _ o u t / s o n o b u o y ' ,
' m a k e . / _ o u t / k u b e c t l ' ,
2020-07-23 11:21:42 -07:00
' g i t f e t c h - - t a g s ' ,
2019-12-23 10:36:14 -08:00
] ,
volumes : volumes . ForStep ( ) ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
// Step standardizes the creation of build steps. The name of the step is used
// as the target when building the make command. For example, if name equals
// "test", the resulting step command will be "make test". This is done to
// encourage alignment between this file and the Makefile, and gives us a
// standardized structure that should make things easier to reason about if we
// know that each step is essentially a Makefile target.
2020-07-01 21:20:24 +03:00
local Step ( name , image = ' ' , target = ' ' , privileged = false , depends_on = [ ] , environment = { } , extra_volumes = [ ] , when = { } ) = {
2019-08-02 16:08:24 -05:00
local make = if target = = ' ' then std.format ( ' m a k e % s ' , name ) else std.format ( ' m a k e % s ' , target ) ,
2019-12-04 10:22:36 -05:00
2020-07-23 11:21:42 -07:00
local common_env_vars = {
// "CI_ARGS": "--cache-to=type=local,dest=/tmp/cache --cache-from=type=local,src=/tmp/cache"
} ,
2019-08-09 03:45:13 +00:00
2019-08-10 21:29:25 +00:00
name : name ,
2019-12-04 10:22:36 -05:00
image : if image = = ' ' then build_container else image ,
2019-09-23 21:45:21 -07:00
pull : " a l w a y s " ,
2019-08-10 21:29:25 +00:00
commands : [ make ] ,
2020-01-21 19:37:12 -08:00
privileged : privileged ,
2019-08-10 21:29:25 +00:00
environment : common_env_vars + environment ,
2020-06-29 21:36:51 +03:00
volumes : volumes . ForStep ( ) + extra_volumes ,
2019-08-09 03:45:13 +00:00
depends_on : [ x . name for x in depends_on ] ,
2020-07-01 21:20:24 +03:00
when : when ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
// Pipeline is a way to standardize the creation of pipelines. It supports
// using and existing pipeline as a base.
2020-07-23 11:21:42 -07:00
local Pipeline ( name , steps = [ ] , depends_on = [ ] , with_docker = true , disable_clone = false , type = ' k u b e r n e t e s ' ) = {
2019-08-02 16:08:24 -05:00
kind : ' p i p e l i n e ' ,
2020-07-23 11:21:42 -07:00
type : type ,
2019-08-09 03:45:13 +00:00
name : name ,
2020-07-23 11:21:42 -07:00
[ if type = = ' d i g i t a l o c e a n ' then ' t o k e n ' ] : {
from_secret : ' d i g i t a l o c e a n _ t o k e n '
} ,
// See https://slugs.do-api.dev/.
[ if type = = ' d i g i t a l o c e a n ' then ' s e r v e r ' ] : {
image : ' u b u n t u - 2 0 - 0 4 - x 6 4 ' ,
size : ' c - 3 2 ' ,
region : ' n y c 3 ' ,
} ,
[ if with_docker then ' s e r v i c e s ' ] : [ docker ] ,
2019-12-10 17:44:07 +00:00
[ if disable_clone then ' c l o n e ' ] : {
disable : true ,
} ,
2019-09-23 21:45:21 -07:00
steps : steps ,
2019-08-10 21:29:25 +00:00
volumes : volumes . ForPipeline ( ) ,
depends_on : [ x . name for x in depends_on ] ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
// Default pipeline.
2020-04-07 22:49:12 +03:00
local docs = Step ( " d o c s " , depends_on = [ setup_ci ] ) ;
local generate = Step ( " g e n e r a t e " , depends_on = [ setup_ci ] ) ;
local check_dirty = Step ( " c h e c k - d i r t y " , depends_on = [ docs , generate ] ) ;
2020-07-23 11:21:42 -07:00
local talosctl_linux = Step ( " t a l o s c t l - l i n u x " , depends_on = [ check_dirty ] ) ;
local talosctl_darwin = Step ( " t a l o s c t l - d a r w i n " , depends_on = [ check_dirty ] ) ;
2020-04-07 22:49:12 +03:00
local kernel = Step ( ' k e r n e l ' , depends_on = [ check_dirty ] ) ;
local initramfs = Step ( " i n i t r a m f s " , depends_on = [ check_dirty ] ) ;
2020-01-04 13:19:34 -08:00
local installer = Step ( " i n s t a l l e r " , depends_on = [ initramfs ] ) ;
2020-02-14 15:26:44 +03:00
local talos = Step ( " t a l o s " , depends_on = [ initramfs ] ) ;
2020-04-07 22:49:12 +03:00
local golint = Step ( " l i n t - g o " , depends_on = [ check_dirty ] ) ;
local markdownlint = Step ( " l i n t - m a r k d o w n " , depends_on = [ check_dirty ] ) ;
local protobuflint = Step ( " l i n t - p r o t o b u f " , depends_on = [ check_dirty ] ) ;
2019-11-01 04:55:58 +00:00
local image_aws = Step ( " i m a g e - a w s " , depends_on = [ installer ] ) ;
2020-04-15 10:46:45 -07:00
local image_azure = Step ( " i m a g e - a z u r e " , depends_on = [ image_aws ] ) ;
local image_digital_ocean = Step ( " i m a g e - d i g i t a l - o c e a n " , depends_on = [ image_azure ] ) ;
local image_gcp = Step ( " i m a g e - g c p " , depends_on = [ image_digital_ocean ] ) ;
local image_vmware = Step ( " i m a g e - v m w a r e " , depends_on = [ image_gcp ] ) ;
2020-02-14 15:26:44 +03:00
local unit_tests = Step ( " u n i t - t e s t s " , depends_on = [ initramfs ] ) ;
2020-07-23 11:21:42 -07:00
local unit_tests_race = Step ( " u n i t - t e s t s - r a c e " , depends_on = [ initramfs ] ) ;
2020-07-30 00:36:58 +03:00
local e2e_docker = Step ( " e 2 e - d o c k e r - s h o r t " , depends_on = [ talos , talosctl_linux , unit_tests , unit_tests_race ] , target = " e 2 e - d o c k e r " , environment = { " SHORT_INTEGRATION_TEST" : " y e s " } ) ;
2020-07-23 11:21:42 -07:00
local e2e_firecracker = Step ( " e 2 e - f i r e c r a c k e r - s h o r t " , privileged = true , target = " e 2 e - f i r e c r a c k e r " , depends_on = [ talosctl_linux , initramfs , kernel , installer , unit_tests , unit_tests_race ] , environment = { " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " , " SHORT_INTEGRATION_TEST" : " y e s " } , when = { event : [ ' p u l l _ r e q u e s t ' ] } ) ;
2019-08-09 03:45:13 +00:00
local coverage = {
2019-08-02 16:08:24 -05:00
name : ' c o v e r a g e ' ,
2020-01-23 20:52:02 -08:00
image : ' a l p i n e : 3 . 1 0 ' ,
environment : {
CODECOV_TOKEN : { from_secret : ' c o d e c o v _ t o k e n ' } ,
2019-08-09 03:45:13 +00:00
} ,
2020-01-23 20:52:02 -08:00
commands : [
' a p k - - n o - c a c h e a d d b a s h c u r l g i t ' ,
' b a s h - c " b a s h < ( c u r l - s h t t p s : / / c o d e c o v . i o / b a s h ) - f _ o u t / c o v e r a g e . t x t - X f i x " '
] ,
2019-08-10 21:29:25 +00:00
when : {
2019-08-02 16:08:24 -05:00
event : [ ' p u l l _ r e q u e s t ' ] ,
2019-08-09 03:45:13 +00:00
} ,
2020-07-23 11:21:42 -07:00
depends_on : [ unit_tests . name , unit_tests_race . name ] ,
2019-08-09 03:45:13 +00:00
} ;
2020-01-01 10:28:44 -08:00
local push = {
name : ' p u s h ' ,
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
pull : ' a l w a y s ' ,
environment : {
DOCKER_USERNAME : { from_secret : ' d o c k e r _ u s e r n a m e ' } ,
DOCKER_PASSWORD : { from_secret : ' d o c k e r _ p a s s w o r d ' } ,
} ,
commands : [ ' m a k e p u s h ' ] ,
volumes : volumes . ForStep ( ) ,
when : {
event : {
exclude : [
' p u l l _ r e q u e s t ' ,
2020-01-01 11:51:48 -08:00
' p r o m o t e ' ,
' c r o n ' ,
2020-01-01 10:28:44 -08:00
] ,
} ,
} ,
2020-01-23 20:52:02 -08:00
depends_on : [ e2e_docker . name , e2e_firecracker . name ] ,
2020-01-01 10:28:44 -08:00
} ;
2019-11-27 15:39:53 +00:00
local push_latest = {
name : ' p u s h - l a t e s t ' ,
2019-08-02 16:08:24 -05:00
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
pull : ' a l w a y s ' ,
environment : {
DOCKER_USERNAME : { from_secret : ' d o c k e r _ u s e r n a m e ' } ,
DOCKER_PASSWORD : { from_secret : ' d o c k e r _ p a s s w o r d ' } ,
2019-08-09 03:45:13 +00:00
} ,
2020-01-01 10:28:44 -08:00
commands : [ ' m a k e p u s h - l a t e s t ' ] ,
2019-08-10 21:29:25 +00:00
volumes : volumes . ForStep ( ) ,
2019-08-09 03:45:13 +00:00
when : {
2020-01-01 11:51:48 -08:00
branch : [
' m a s t e r ' ,
] ,
event : [
' p u s h ' ,
2020-01-01 09:43:24 -08:00
] ,
2019-08-09 03:45:13 +00:00
} ,
2020-01-23 20:52:02 -08:00
depends_on : [ e2e_docker . name , e2e_firecracker . name ] ,
2019-08-09 03:45:13 +00:00
} ;
2019-08-10 21:29:25 +00:00
local default_steps = [
2019-12-24 09:28:58 -08:00
setup_ci ,
2020-04-07 22:49:12 +03:00
docs ,
generate ,
check_dirty ,
2020-07-23 11:21:42 -07:00
talosctl_linux ,
talosctl_darwin ,
2020-01-21 19:37:12 -08:00
kernel ,
2019-08-09 03:45:13 +00:00
initramfs ,
2019-08-10 21:29:25 +00:00
installer ,
2019-12-24 12:23:52 -08:00
talos ,
2019-12-24 09:28:58 -08:00
golint ,
2019-08-17 08:51:40 +00:00
markdownlint ,
2020-04-07 22:49:12 +03:00
protobuflint ,
2019-11-01 04:55:58 +00:00
image_aws ,
image_azure ,
image_digital_ocean ,
image_gcp ,
image_vmware ,
2019-08-09 03:45:13 +00:00
unit_tests ,
2019-09-02 21:55:42 +03:00
unit_tests_race ,
2019-08-09 03:45:13 +00:00
coverage ,
2020-01-23 20:52:02 -08:00
e2e_docker ,
e2e_firecracker ,
2020-01-01 10:28:44 -08:00
push ,
2019-11-27 15:39:53 +00:00
push_latest ,
2019-08-09 03:45:13 +00:00
] ;
local default_trigger = {
trigger : {
cron : {
2019-08-02 16:08:24 -05:00
exclude : [ ' n i g h t l y ' ] ,
2019-08-09 03:45:13 +00:00
} ,
2019-08-12 18:28:42 +00:00
event : {
2019-08-13 00:40:00 +00:00
exclude : [
2019-08-02 16:08:24 -05:00
' t a g ' ,
' p r o m o t e ' ,
] ,
2019-08-09 03:45:13 +00:00
} ,
} ,
} ;
2020-04-10 17:06:59 -07:00
local default_pipeline = Pipeline ( ' d e f a u l t ' , default_steps ) + default_trigger ;
2019-08-10 21:29:25 +00:00
2020-06-25 22:56:59 +03:00
// Full integration pipeline.
2020-07-27 19:28:28 +03:00
local integration_firecracker = Step ( " e 2 e - f i r e c r a c k e r " , privileged = true , depends_on = [ initramfs , talosctl_linux , kernel , installer , unit_tests , unit_tests_race ] , environment = { " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " } ) ;
local integration_provision_tests_prepare = Step ( " p r o v i s i o n - t e s t s - p r e p a r e " , privileged = true , depends_on = [ initramfs , talosctl_linux , kernel , installer , unit_tests , unit_tests_race , e2e_firecracker , e2e_docker ] ) ;
2020-07-23 11:21:42 -07:00
local integration_provision_tests_track_0 = Step ( " p r o v i s i o n - t e s t s - t r a c k - 0 " , privileged = true , depends_on = [ integration_provision_tests_prepare ] , environment = { " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " } ) ;
local integration_provision_tests_track_1 = Step ( " p r o v i s i o n - t e s t s - t r a c k - 1 " , privileged = true , depends_on = [ integration_provision_tests_prepare ] , environment = { " FIRECRACKER_GO_SDK_REQUEST_TIMEOUT_MILLISECONDS" : " 2 0 0 0 " } ) ;
2020-07-01 18:34:20 +03:00
local integration_cilium = Step ( " e 2 e - c i l i u m - 1 . 8 . 0 " , target = " e 2 e - f i r e c r a c k e r " , privileged = true , depends_on = [ integration_firecracker ] , environment = {
" F I R E C R A C K E R _ G O _ S D K _ R E Q U E S T _ T I M E O U T _ M I L L I S E C O N D S " : " 2 0 0 0 " ,
" S H O R T _ I N T E G R A T I O N _ T E S T " : " y e s " ,
" C U S T O M _ C N I _ U R L " : " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / c i l i u m / c i l i u m / v 1 . 8 . 0 / i n s t a l l / k u b e r n e t e s / q u i c k - i n s t a l l . y a m l " ,
} ) ;
2020-06-25 22:56:59 +03:00
local integration_steps = default_steps + [
integration_firecracker ,
integration_provision_tests_prepare ,
integration_provision_tests_track_0 ,
integration_provision_tests_track_1 ,
2020-07-01 18:34:20 +03:00
integration_cilium ,
2020-06-25 22:56:59 +03:00
] ;
local integration_trigger = {
trigger : {
target : {
include : [ ' i n t e g r a t i o n ' ] ,
} ,
} ,
} ;
2020-07-02 00:11:26 +03:00
local integration_nightly_trigger = {
trigger : {
cron : {
include : [ ' n i g h t l y ' ] ,
} ,
} ,
} ;
2020-06-25 22:56:59 +03:00
local integration_pipeline = Pipeline ( ' i n t e g r a t i o n ' , integration_steps ) + integration_trigger ;
2020-07-02 00:11:26 +03:00
local integration_nightly_pipeline = Pipeline ( ' i n t e g r a t i o n - n i g h t l y ' , integration_steps ) + integration_nightly_trigger ;
2020-06-25 22:56:59 +03:00
2019-08-10 21:29:25 +00:00
// E2E pipeline.
local creds_env_vars = {
2020-01-23 20:52:02 -08:00
AWS_ACCESS_KEY_ID : { from_secret : ' a w s _ a c c e s s _ k e y _ i d ' } ,
AWS_SECRET_ACCESS_KEY : { from_secret : ' a w s _ s e c r e t _ a c c e s s _ k e y ' } ,
AWS_SVC_ACCT : { from_secret : " a w s _ s v c _ a c c t " } ,
AZURE_SVC_ACCT : { from_secret : " a z u r e _ s v c _ a c c t " } ,
// TODO(andrewrynhard): Rename this to the GCP convention.
GCE_SVC_ACCT : { from_secret : " g c e _ s v c _ a c c t " } ,
PACKET_AUTH_TOKEN : { from_secret : " p a c k e t _ a u t h _ t o k e n " } ,
2019-08-09 03:45:13 +00:00
} ;
2020-07-30 00:36:58 +03:00
local e2e_capi = Step ( " e 2 e - c a p i " , depends_on = [ e2e_docker ] , environment = creds_env_vars ) ;
local e2e_aws = Step ( " e 2 e - a w s " , depends_on = [ e2e_capi ] , environment = creds_env_vars ) ;
local e2e_azure = Step ( " e 2 e - a z u r e " , depends_on = [ e2e_capi ] , environment = creds_env_vars ) ;
local e2e_gcp = Step ( " e 2 e - g c p " , depends_on = [ e2e_capi ] , environment = creds_env_vars ) ;
2019-08-10 21:29:25 +00:00
local e2e_steps = default_steps + [
2020-01-23 20:52:02 -08:00
e2e_capi ,
e2e_aws ,
e2e_gcp ,
2019-08-10 21:29:25 +00:00
] ;
2019-08-09 03:45:13 +00:00
local e2e_trigger = {
trigger : {
target : {
2019-08-02 16:08:24 -05:00
include : [ ' e 2 e ' ] ,
2019-08-09 03:45:13 +00:00
} ,
} ,
} ;
2019-08-02 16:08:24 -05:00
local e2e_pipeline = Pipeline ( ' e 2 e ' , e2e_steps ) + e2e_trigger ;
2019-08-10 21:29:25 +00:00
// Conformance pipeline.
2020-07-30 00:36:58 +03:00
local conformance_aws = Step ( " e 2 e - a w s " , depends_on = [ e2e_capi ] , environment = creds_env_vars + { SONOBUOY_MODE : " c e r t i f i e d - c o n f o r m a n c e " } ) ;
local conformance_azure = Step ( " e 2 e - a z u r e " , depends_on = [ e2e_capi ] , environment = creds_env_vars + { SONOBUOY_MODE : " c e r t i f i e d - c o n f o r m a n c e " } ) ;
local conformance_gcp = Step ( " e 2 e - g c p " , depends_on = [ e2e_capi ] , environment = creds_env_vars + { SONOBUOY_MODE : " c e r t i f i e d - c o n f o r m a n c e " } ) ;
2019-08-10 21:29:25 +00:00
2019-11-27 15:39:53 +00:00
local push_edge = {
name : ' p u s h - e d g e ' ,
image : ' a u t o n o m y / b u i l d - c o n t a i n e r : l a t e s t ' ,
pull : ' a l w a y s ' ,
environment : {
DOCKER_USERNAME : { from_secret : ' d o c k e r _ u s e r n a m e ' } ,
DOCKER_PASSWORD : { from_secret : ' d o c k e r _ p a s s w o r d ' } ,
} ,
2020-01-01 10:28:44 -08:00
commands : [ ' m a k e p u s h - e d g e ' ] ,
2019-11-27 15:39:53 +00:00
volumes : volumes . ForStep ( ) ,
when : {
2020-01-01 09:43:24 -08:00
cron : [
' n i g h t l y ' ,
] ,
2019-11-27 15:39:53 +00:00
} ,
2019-12-27 07:32:31 -08:00
depends_on : [ conformance_aws . name , conformance_gcp . name ] ,
2019-11-27 15:39:53 +00:00
} ;
2019-08-10 21:29:25 +00:00
local conformance_steps = default_steps + [
2020-01-23 20:52:02 -08:00
e2e_capi ,
2019-09-09 22:21:58 +00:00
conformance_aws ,
2019-08-11 21:38:24 +00:00
conformance_gcp ,
2019-11-27 15:39:53 +00:00
push_edge ,
2019-08-10 21:29:25 +00:00
] ;
2019-08-09 03:45:13 +00:00
local conformance_trigger = {
trigger : {
target : {
2019-08-02 16:08:24 -05:00
include : [ ' c o n f o r m a n c e ' ] ,
2019-08-09 03:45:13 +00:00
} ,
} ,
} ;
2019-08-02 16:08:24 -05:00
local conformance_pipeline = Pipeline ( ' c o n f o r m a n c e ' , conformance_steps ) + conformance_trigger ;
2019-08-10 21:29:25 +00:00
// Nightly pipeline.
local nightly_trigger = {
trigger : {
cron : {
2019-08-02 16:08:24 -05:00
include : [ ' n i g h t l y ' ] ,
2019-08-10 21:29:25 +00:00
} ,
} ,
} ;
2019-08-02 16:08:24 -05:00
local nightly_pipeline = Pipeline ( ' n i g h t l y ' , conformance_steps ) + nightly_trigger ;
2019-08-10 21:29:25 +00:00
// Release pipeline.
2020-01-23 20:52:02 -08:00
local iso = Step ( ' i s o ' , depends_on = [ e2e_docker , e2e_firecracker ] ) ;
local boot = Step ( ' b o o t ' , depends_on = [ e2e_docker , e2e_firecracker ] ) ;
2019-08-11 16:54:33 +00:00
2020-07-28 13:55:47 -07:00
local release_notes = Step ( ' r e l e a s e - n o t e s ' , depends_on = [ e2e_docker , e2e_firecracker ] ) ;
2019-08-10 21:29:25 +00:00
// TODO(andrewrynhard): We should run E2E tests on a release.
2019-08-02 16:08:24 -05:00
local release = {
name : ' r e l e a s e ' ,
image : ' p l u g i n s / g i t h u b - r e l e a s e ' ,
settings : {
api_key : { from_secret : ' g i t h u b _ t o k e n ' } ,
2019-08-10 21:29:25 +00:00
draft : true ,
2020-07-28 13:55:47 -07:00
note : ' _ o u t / R E L E A S E _ N O T E S . m d ' ,
2019-12-30 17:16:37 -08:00
files : [
' _ o u t / a w s . t a r . g z ' ,
' _ o u t / a z u r e . t a r . g z ' ,
2020-01-09 12:25:25 -08:00
' _ o u t / b o o t . t a r . g z ' ,
2019-12-30 17:16:37 -08:00
' _ o u t / c o n t a i n e r . t a r ' ,
' _ o u t / d i g i t a l - o c e a n . t a r . g z ' ,
' _ o u t / g c p . t a r . g z ' ,
' _ o u t / i n i t r a m f s . x z ' ,
' _ o u t / i n s t a l l e r . t a r ' ,
2020-03-20 17:38:48 -07:00
' _ o u t / t a l o s c t l - d a r w i n - a m d 6 4 ' ,
' _ o u t / t a l o s c t l - l i n u x - a m d 6 4 ' ,
2020-03-21 14:27:03 -07:00
' _ o u t / t a l o s c t l - l i n u x - a r m 6 4 ' ,
2020-03-21 18:08:09 -07:00
' _ o u t / t a l o s c t l - l i n u x - a r m v 7 ' ,
2019-12-30 17:16:37 -08:00
' _ o u t / v m w a r e . o v a ' ,
' _ o u t / v m l i n u x ' ,
' _ o u t / v m l i n u z ' ,
] ,
2019-08-02 16:08:24 -05:00
checksum : [ ' s h a 2 5 6 ' , ' s h a 5 1 2 ' ] ,
2019-08-10 21:29:25 +00:00
} ,
when : {
2019-08-02 16:08:24 -05:00
event : [ ' t a g ' ] ,
2019-08-10 21:29:25 +00:00
} ,
2020-07-28 13:55:47 -07:00
depends_on : [ kernel . name , iso . name , boot . name , image_gcp . name , image_azure . name , image_aws . name , push . name , release_notes . name ]
2019-08-10 21:29:25 +00:00
} ;
local release_steps = default_steps + [
2019-08-11 17:29:45 +00:00
iso ,
2020-01-09 12:25:25 -08:00
boot ,
2020-07-28 13:55:47 -07:00
release_notes ,
2019-08-11 16:54:33 +00:00
release ,
2019-08-10 21:29:25 +00:00
] ;
2019-08-09 03:45:13 +00:00
local release_trigger = {
trigger : {
2019-08-11 17:52:20 +00:00
event : [
2019-08-02 16:08:24 -05:00
' t a g ' ,
2019-08-11 17:52:20 +00:00
] ,
2019-08-09 03:45:13 +00:00
} ,
} ;
2019-08-02 16:08:24 -05:00
local release_pipeline = Pipeline ( ' r e l e a s e ' , release_steps ) + release_trigger ;
2019-08-10 21:29:25 +00:00
// Notify pipeline.
local notify = {
2019-08-02 16:08:24 -05:00
name : ' s l a c k ' ,
image : ' p l u g i n s / s l a c k ' ,
2020-07-23 11:21:42 -07:00
settings : {
2019-08-02 16:08:24 -05:00
webhook : { from_secret : ' s l a c k _ w e b h o o k ' } ,
2019-09-09 10:51:10 -05:00
channel : ' p r o j - t a l o s - m a i n t a i n e r s ' ,
2019-10-22 16:07:31 +03:00
link_names : true ,
template : ' { { # i f b u i l d . p u l l } }
* { { #success build.status}}✓ Success{{else}}✕ Fail{{/success}}*: {{ repo.owner }}/{{ repo.name }} - <https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ build.pull }}|Pull Request #{{ build.pull }}>
{ { else } }
* { { #success build.status}}✓ Success{{else}}✕ Fail{{/success}}: {{ repo.owner }}/{{ repo.name }} - Build #{{ build.number }}* (type: `{{ build.event }}`)
{ { / if } }
Commit : < https : //github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}>
Branch : < https : //github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>
Author : { { build . a u t h o r } }
< { { build . l i n k } } | V i s i t b u i l d p a g e > '
2019-08-10 21:29:25 +00:00
} ,
2020-07-23 11:21:42 -07:00
when : {
status : [
' s u c c e s s ' ,
' f a i l u r e '
] ,
} ,
2019-08-10 21:29:25 +00:00
} ;
local notify_steps = [ notify ] ;
2019-08-09 03:45:13 +00:00
local notify_trigger = {
trigger : {
2019-08-02 16:08:24 -05:00
status : [ ' s u c c e s s ' , ' f a i l u r e ' ] ,
2019-08-09 03:45:13 +00:00
} ,
} ;
2020-07-02 00:11:26 +03:00
local notify_pipeline = Pipeline ( ' n o t i f y ' , notify_steps , [ default_pipeline , e2e_pipeline , integration_pipeline , integration_nightly_pipeline , conformance_pipeline , nightly_pipeline , release_pipeline ] , false , true ) + notify_trigger ;
2019-08-10 21:29:25 +00:00
// Final configuration file definition.
2019-08-09 03:45:13 +00:00
[
default_pipeline ,
2020-06-25 22:56:59 +03:00
integration_pipeline ,
2020-07-02 00:11:26 +03:00
integration_nightly_pipeline ,
2019-08-09 03:45:13 +00:00
e2e_pipeline ,
conformance_pipeline ,
nightly_pipeline ,
release_pipeline ,
notify_pipeline ,
]