chad, thx for your reply. re: using environments rather than resources... environments can't be defined at the pipeline level either though?
or i guess it's more correct to say that using environments is a bit of a side-car feature, in that we use interact w/environments through a different prisim/ui/config (no biggie) but also seems it's mutually exclusive to maximizing overall usage of agents. for us if a given host can execute something (a pipeline, a job) it should. and if it can't, it shouldn't. trying to force a hard divider can be useful for prod/qa staging, but it seems to limit just being able to have pipelines declare their needs. maybe i'm missing what you're saying but i don't think environments are functionally equivalent to resources? we use template parameters extensively already. eg we even templatize further inside our own jobs by re-using scripts that interact with template parameters on most commonly used templates (eg our most popular template has maybe 10-15 pipelines). however this is more of a job specific thing since it's at the job level. if you're saying we could change every pipeline to read this at a pipeline level is a non trivial change to every job. that's ok but i guess my overall question tho would be that if a given job decided it couldn't execute the pipeline parameters... it has no way to pass the job to another agent? in such an example it would just fail the job, no? again maybe i'm not following but this seems to not allow the business/value level to declare minimum needs (environments seem like they are more about maximimal requirements, but i'm no expert) On Sat, Jul 22, 2023 at 6:56 AM Chad Wilson <[email protected]> wrote: > Have you tried to use "environments" (or a mix of environments and > resources) to achieve what you are trying to? > > When scheduling jobs it's the combination of the resource and the > environment that are matched to an agent, but the relevant environment is > declared at the pipeline level like you refer to. Don't need to get hung up > on the name so much. Yes, you can have "environment variables" attached to > an environment and propagate those to all pipelines within it, but you > don't have to use them like that. > > Alternatively, to make the templates less duplicated and allow the > resource to flow from the pipeline *using* the template, you could try > using template parameters > <https://docs.gocd.org/current/configuration/admin_use_parameters_in_configuration.html> > in the resources field? e.g #{job-resoure-requirement}? If there are only a > small number of different resources used across the stages/jobs, you could > use the parameters to "model" this I imagine. > > -Chad > > On Sat, Jul 22, 2023 at 6:54 PM Josh <[email protected]> wrote: > >> QUESTION: >> >> Shouldn't we also be able to communicate a resource requirement at the >> pipeline level, and not just inside a single job? >> >> I get that it definately needs to be at the job level since that's the >> smallest unit of work and some machines can't execute certain tasks. >> But at the value-stream/pipeline/business level, you also want to be able >> to have some pipelines compiling on preferred resources, no? >> >> >> is there a better way to accomplish this? >> or perhaps this already is possible and i'm missing it. >> i looked closely at the config since sometimes you can do something >> simple that is not possible inside the UI, but I'm not seeing it. >> >> To restate use case: We have some pipelines that are given higher >> preferences for agent/build resources. Wanting to do a lot more of this, >> but it's tricky because resources can only be defined at the job level (in >> the UI). Also we use a lot of templates, so having resources at job >> level means we end up having lots of alsomost identical templates that only >> vary by the resources used (which somewhat defeats the point of the >> templates and the value of gocd in this respect). >> >> hoping there is a config hack or maybe i'm missinig something. >> also if this could be done in a plugin, any color there would be helpful >> (and i would make sure it's open sourced if need be). >> >> thx >> >> ps i keep using other ci/cd products and gocd is still one of the all >> around bests. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "go-cd" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/go-cd/a9a4ba2c-b1c9-4202-9408-3e2566929b59n%40googlegroups.com >> <https://groups.google.com/d/msgid/go-cd/a9a4ba2c-b1c9-4202-9408-3e2566929b59n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "go-cd" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/go-cd/_j5JGmoA2kI/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/go-cd/CAA1RwH8zGo6mu0ss0jCCyw0D7Hw4JOwEwfcfNu20yqo0aRRdWw%40mail.gmail.com > <https://groups.google.com/d/msgid/go-cd/CAA1RwH8zGo6mu0ss0jCCyw0D7Hw4JOwEwfcfNu20yqo0aRRdWw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "go-cd" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CABr%2BOtrG%2B0X3y4B6AWnN7N0K-OSpcKb4KdG-LbS8fCnMOR8Zdw%40mail.gmail.com.
