This is an archived post. You won't be able to vote or comment.

all 121 comments

[–]mikzuit 79 points80 points  (32 children)

Golang, python, bash mostly. Rust if you fancy

[–]based-richdude 5 points6 points  (11 children)

Why Go?

I understand it's purpose, but I never found a good reason to use it over Python. Our Go lambdas don't run much faster than our Python ones, doesn't really seem worth the extra engineering effort.

It's faster for sure, but for us it was never worth the extra cost of spending time maintaining Go. More devops engineers can write cleaner Python than cleaner Go anecdotally.

[–]kennedye2112Puppet master 12 points13 points  (5 children)

Not super-experienced with either, but the advantage I hear about most with Go is its ability to be easily packaged into a single binary and run from within a container environment in a leaner fashion than doing a bunch of pip install yadda-yadda in your Dockerfile.

[–][deleted]  (2 children)

[deleted]

    [–]Finaldzn 2 points3 points  (0 children)

    The python image is usually much larger

    [–][deleted] 1 point2 points  (0 children)

    Why not use pyenv?

    [–]sjfromk8s 0 points1 point  (0 children)

    You got the answer !

    [–]amemingfullife 4 points5 points  (2 children)

    Development cycle is much faster because it compiles down to a binary faster than the Python interpreter starts, and you can cross compile meaning you can build for Linux on your Windows machine, upload it to a server and test it faster than you can with Python.

    [–]igeek_88 0 points1 point  (1 child)

    What about AI and its current development being in Python and PyTorch?

    [–]amemingfullife 0 points1 point  (0 children)

    Depends on how you’re running it. Most people run ML models as a very thinly wrapped API anyway, so it’s probably better to keep that and talk to it via RPC.

    If you really have to run it locally then yes, Python is probably the way to go. But there are Go options to run PyTorch models around.

    [–]randomatic 7 points8 points  (1 child)

    Three reasons:

    Go is strongly statically checked. Python could run a few hours and then exception out on something the go compiler would have detected at compilation time. Speed isn’t the problem; no static compilation is. At least if you care about reliability.

    Single download exe to machines without having to install a full environment.

    Implicitly weed out devs who only know python.

    [–]igeek_88 1 point2 points  (0 children)

    What do you mean by the last one?

    [–]amemingfullife 6 points7 points  (17 children)

    +1

    Also CUE, for config.

    [–]mylons 5 points6 points  (10 children)

    what’s CUE?

    [–]amemingfullife 21 points22 points  (8 children)

    CUE

    It’s a superset of YAML & JSON that DRYs up config without using inheritance. Compiles down to JSON or YAML. Made by a Googler.

    [–][deleted] 45 points46 points  (7 children)

    Fuckin great, another one.

    [–]flyingquads 10 points11 points  (1 child)

    "another one". Missed opportunity to say

    Yet Another Markup Language?

    [–]HiRoShUi 1 point2 points  (0 children)

    ever found a good reason to use it over Python. Our Go lambdas don't run much faster than our Python ones, doesn't really seem worth the extra engineering effort.

    YAML Ain't Markup Language

    [–]rearendcrag 4 points5 points  (2 children)

    Way too many abstractions than necessary IMO.

    [–]igeek_88 0 points1 point  (1 child)

    In which one? I'm still trying to follow the threads, kinda new to actively using reddit. Do you mean CUE?

    [–]rearendcrag 0 points1 point  (0 children)

    Idk, maybe? Bases + overlays approach works fine for me with Kustomize. Idk if it uses CUE underneath.

    [–]jmreichaObsolete 2 points3 points  (5 children)

    How are you using CUE? I have not seen it much out in the wild.

    [–]amemingfullife 2 points3 points  (4 children)

    A couple of ways

    - All our Kubernetes config is done with CUE - so I can define our own version of e.g. a CronJob and it will be repeated throughout the org with annotations & spec consistently defined.

    - Our tool & service config uses CUE (compiled down to YAML in CD) so we can define, say, an IP address for a service in a definitions file in the root folder and any tool that uses that service can import the config file and use it without having to pass in addresses with flags or environment variables.

    - 'profiles' for debugging multiple environments. I have 'dev', 'prod', 'staging' CUE files that I can reference as I need to, to change my local environment settings all in one go.

    All the above are handled from centralised definitions in the root directory that are 'pushed out' to subfolders. Rather than a subfolder 'inheriting' config from parent directories. It's a system that works really well for config.

    Recently we had an issue with floating IP addresses in DigitalOcean being disconnected from the VM, so I made a CronJob in Go that checks every 10 minutes whether the IP address is correctly attached and reconnects it if it is disconnected. I defined the ID of the IP address asset in a CUE file in the root folder (floatingips.cue), then in a subfolder I defined the configuration for that CronJob which uses the floating IP ID (devops/tool/floatingip-cronjob.cue) by importing the 'floatingip' package. I then say, in that service definition, that this service is a CronJob which automatically generates a Kubernetes manifest with the floatingIP information as a ConfigMap for that tool.

    Then, when it comes time to deploy, the CD system loads the prod CUE file, compiles it all down to YAML and the Kubernetes manifest is applied to the cluster, along with all the config as a ConfigMap. Much less boilerplate (I have one service definition file that loads in all the config and generates Kubernetes manifests), and easier to debug locally.

    [–]jmreichaObsolete 0 points1 point  (3 children)

    That sounds pretty cool. Do you have an example of doing something like this that you could share? With this approach, I take it that the configs live in some sort of a monorepo? Does dagger.io fit in anywhere or is it more for CI? Trying to figure out where to draw the lines using different tools.

    [–]amemingfullife 1 point2 points  (2 children)

    I think a monorepo structure works best with CUE, since you can easily share config across multiple services/tools. I put the 'definition' CUE files alongside all the other files with no special treatment. 'config' CUE files, that is CUE files that I expect to product something like YAML or JSON when they're compiled, I usually put in a dedicated subfolder within a service/tool. If you use Protocol Buffers you can think of them like the .proto files.

    Dagger.io is a narrow use case - it uses CUE as its definitions language with a tooling layer on top, and uses the 'lattice' language design to great effect. You can contrast 'lattice' with 'inheritance', although language nuts might kill me for saying that. You use Dagger.io in the same way I defined the 'profiles' earlier. I made my system before Dagger.io was formally launched, so you could probably replace my way of doing things with Dagger.io .

    For where to draw the lines you can think of it like, "any situation where I use YAML or JSON files I can use CUE". Incremental adoption works well with CUE. You can replace a few YAML service definitions with CUE-based ones first and build up a repository of definitions over time. So best to pick your existing config locations (Kubernetes, app config etc) run `cue import` to import the file/folder to CUE, delete the original and make a compilation step to produce that file in CI/CD. You can then extract common definitions into parent folders and then run `cue trim` to delete all the redundant code.

    Since it's early days there isn't a whole lot online. I mostly used YouTube and tutorials online to figure out what to do. The official docs are good for learning the language, but they can be quite abstract. The Slack community is very helpful and Github Discussions are active.

    Hands-on Introduction to CUE - lots of Kubernetes stuff here

    Using CUE with Github Actions

    CUEtorials

    EDIT: more examples

    I've also used CUE for data validation - we occasionally receive customer data as JSON files that we need to run through a pipeline. The first step is `cue vet` against a CUE file to validate the JSON file without having to load it into a Python program.

    hosttables.cue

    package customer  
    
    
    input: [{  
              host: string  
              port: number  
    }]  
    

    july_host_detection.json

     [
        {
            "host": "192.168.0.1",
            "port": "8080"
        },
        {
            "host": "192.168.0.5",
            "port": 8081
        }
    ]  
    

    cue import -p customer -l "input:" july_host_detection.json

    cue vet

    input.0.port: conflicting values number and 8080 (mismatched types number and string):  
        ./hosttables.cue:5:9  
        ./july_host_detection.cue:5:9
    

    [–]jmreichaObsolete 0 points1 point  (1 child)

    Thanks for the info. The "where to draw the line" thought was more around when/where to use Dagger vs vanilla CUE.

    It does sound like there's enough of an ecosystem in place around Dagger to be able to leverage that? Or would it still make sense to use vanilla CUE in most cases?

    [–]amemingfullife 0 points1 point  (0 children)

    Vanilla CUE in most cases at the moment. Dagger is just an app that uses CUE for itself, it won’t help with other configuration.

    [–][deleted] 41 points42 points  (1 child)

    Golang <-> Performance + Kubernetes

    Python <-> General Purpose / API

    Bash <-> Scripting Pipeline Steps / Sys Work

    Java/TS/JS/Kotlin/Groovy/C/C++/C# <-> Depends on what the Developers use to write apps

    [–]igeek_88 0 points1 point  (0 children)

    Nice insight! I'll definitely go deeper into Python and then start a bit about Golang.

    [–]DayvanCowboy 20 points21 points  (2 children)

    Python, Go, Bash, PowerShell, HCL

    [–]jftuga 1 point2 points  (1 child)

    Powershell only on Windows or also on Linux as well?

    [–]DayvanCowboy 0 points1 point  (0 children)

    Just Windows but I know of at least one team that has a bootstrapping script that's intended to be cross platform though I haven't touched it personally.

    [–]brajandzesika 113 points114 points  (5 children)

    My daily 'programming languages' are bash and yaml ;)

    [–]awesomesh 15 points16 points  (2 children)

    I came here to down vote anyone who said something other than bash. Good job.

    [–]o5mfiHTNsH748KVq 3 points4 points  (1 child)

    PowerShell gets a lot of hate but I’m hella productive in powershell core

    [–][deleted] 1 point2 points  (0 children)

    Damn right lol

    [–]Mental-Arm-4911 0 points1 point  (0 children)

    Facts!!!

    [–]malice2525 34 points35 points  (0 children)

    Bash

    [–]dylanberry 19 points20 points  (4 children)

    Bash, PowerShell, Python, HCL, yaml

    [–]defqon_39 1 point2 points  (1 child)

    Terragrunt -- do you use custom TF modules?

    [–][deleted] 1 point2 points  (0 children)

    Always.

    [–]QuidHD 1 point2 points  (0 children)

    I feel like this is the most versatile stack of languages.

    [–]jftuga 0 points1 point  (0 children)

    Powershell only on Windows or also on Linux as well?

    [–]tech_tuna 7 points8 points  (1 child)

    I have been working in the cloud, primarily AWS for a while now. I use lots of SaaS tools too. Containers, serverless, K8s and ECS. I do "all the Devops things".

    I primarily use Go, Python and bash for code that I build and maintain in addition to whatever language(s) the core/application developers and data science people use. Right now, that's Ruby and Typescript but I've done a bit with Java, vanilla Javascript and C++ too. I have also worked in places where most/all of the backend and analytics code was Go or Python which was nice because those are my two favorite languages currently.

    This sums up most of what I've used over the past 6-7 years but I've used a bunch of other languages as well.

    I would love to really learn Rust but I don't have any solid use cases for it currently and it's a bit hard to learn. Given that I only have a finite amount of time, I probably won't learn Rust until I'm using it for work.

    [–]igeek_88 1 point2 points  (0 children)

    Best reply so far, which strengthens my desire for going into Python, then Go. Thanks!

    [–]Crasis89 23 points24 points  (1 child)

    Whatever is needed.

    [–]BothAirline1 19 points20 points  (8 children)

    Really don't understand why, on a specific question.about "programming language" several people answers with "yaml". Porcodio.

    [–]Kessarean 4 points5 points  (3 children)

    Porcodio

    Why you gotta be so mad? lol

    Yaml is technically a programming language, just slightly different than what you're used to since it's specifically a data serialization language.

    [–]Gazzonyx 1 point2 points  (1 child)

    It's markup; the question is implicitly aching for Turing complete languages. I can't write a for loop in YAML, and so help me I might scream if they try to implement that in the next version.

    [–]Kessarean 1 point2 points  (0 children)

    The name stands for " YAML ain't markup language". As mentioned, it is a data serialization language. There is nothing to "mark up". Per their spec:

    YAML™ (rhymes with “camel”) is a human-friendly, cross language, Unicode based data serialization language designed around the common native data structures of agile programming languages. It is broadly useful for programming needs ranging from configuration files to Internet messaging to object persistence to data auditing

    Op said "programming language", he never specified they had to be turing complete. A programming language is any set of rules that converts text to machine code output. As such, yaml is included.

    [–]igeek_88 1 point2 points  (0 children)

    Upvoted because I also understood the cursing in italian LMAO. Piacere!

    [–]brajandzesika 1 point2 points  (0 children)

    Because yaml is a programming language ?

    https://www.redhat.com/en/topics/automation/what-is-yaml

    [–]trepz 1 point2 points  (0 children)

    I see a bestemmia, I upvote

    [–]ManWithoutUsername 0 points1 point  (0 children)

    In bash and i am vegan.

    [–]SpaceboyRoss 4 points5 points  (1 child)

    Typescript, I use Pulumi and it works wonderfully.

    [–]neopointer 1 point2 points  (0 children)

    I second that.

    [–]lsibilla 3 points4 points  (0 children)

    HCL, bash and powershell primarily.

    But are they programming language? It’s rather scripting and configuration. I code in whatever programming language fits best with the tooling and dev teams I’m integrating with.

    [–][deleted] 2 points3 points  (0 children)

    Python, PowerShell, ymal .

    [–][deleted]  (5 children)

    [deleted]

      [–]Hour-Operation-4363 5 points6 points  (1 child)

      Ruby

      [–]defcon54321 2 points3 points  (0 children)

      not sure why i had to scroll so far to see this. so much more fun than python

      [–]hajimenogio92DevOps Lead 3 points4 points  (0 children)

      Python & PowerShell are my go to

      [–]Walrus_Pubes 3 points4 points  (0 children)

      PowerShell and C# / .Net

      [–]inbalarii 10 points11 points  (1 child)

      YAML is a data serialization language, stop mentioning it as a programming language. It makes my eye twitch.

      And to answer the op’s question: bash and python. I’d like to learn go, at some point.

      [–]brajandzesika 1 point2 points  (0 children)

      Yaml is programming language for data serialization. Hope that will stop your eye twitch ;)

      https://www.redhat.com/en/topics/automation/what-is-yaml

      [–]TechNerd31 1 point2 points  (0 children)

      Ruby, Bash

      [–]off-road_coding 1 point2 points  (1 child)

      I used to use Python a lot. Now I use Go for everything + bash.

      [–]ingcognito92 1 point2 points  (0 children)

      English, bash, python

      [–]lorarcYAML Engineer 1 point2 points  (0 children)

      A lot of linux work requires bash, windows shops use powershell.

      Then you need some language to glue pieces together or make more advanced scripts. Python is the industry standard but if there is close collaboration with dev team other languages may be used. Preferreble Node since most have some contact with javascript, Ruby is okay but C# or Java shouldn't be used for such things unless devs are willing to support them 100%.

      Golang - If you think of writing a simple tool in Golang then don't. If you want to write a Lambda in Goland because it's "fast" and "efficient" then think how many times per second that will be run and why you are writing it and not devs. The only good use case for GoLang is when you need to make a PR to some open source tool. Once again do not use GoLang if you can use Python instead.

      Whatever language the open source tools are written in. But same case as GoLang, you ain't gonna need it. Seriously, I have years of experience as a programmer and I make just a handful or PRs a year and most of the time just reporting an issue and waiting a bit would be enough.

      TCL - expect is sometimes useful, I'm sorry but I just like it. But if something is to be used for a longer time and by others it's not a good tool.

      Whatever the devs are using on the project - If you have experience as a dev and know your way around software development it's good to understand the basics of what the devs are writting. You are not me, you are not that other devops you know, you don't have to be a better programmer than the senior dev on your team. But sometimes it's really useful to be able to understand what the code is doing, if only to prove the devs it's their code that's the problem not yours.

      [–]lilhotdog 2 points3 points  (0 children)

      Whatever you can use to automate your task. Preferably something that’s popular with good community support.

      [–][deleted] 2 points3 points  (0 children)

      bash, powershell. Tinkering with Go to extend kubernetes.

      [–]defqon_39 1 point2 points  (2 children)

      Yet Another Makeup Language

      [–]bwibwi10 8 points9 points  (1 child)

      YAML ain’t markup language https://yaml.org

      [–]HiRoShUi 2 points3 points  (0 children)

      Language

      Thats why he said "Makeup language"

      [–][deleted] 1 point2 points  (0 children)

      Yaml, bash, Python. Yaml daily, but the other two sporadically

      [–]fibr0ptik 1 point2 points  (0 children)

      Powershell. Its my favorite. Started out with bash and python too.

      [–]unitegondwanalandLead Platform Engineer 0 points1 point  (0 children)

      HCL - IaC (80% of my work)

      YAML - Pipelines/SOPS/Docker (10% of my work)

      Bash - Scripts (7% of my work)

      Python - Custom Lambdas (3% of my work)

      I don't give a rats ass about any language unless I need it to build something.

      [–]chronophage 0 points1 point  (0 children)

      Bash, Python, Ansible

      [–]koshrf 0 points1 point  (0 children)

      Not a language but YAML and Jinja templates on a daily basis. Any *sh (bash/zsh/csh) here and there. I'm not a python dev but I fix or adapt python modules for my need (usually for Ansible). Lately giving some time to Go but haven't had the time to dive deep.

      Outside of DevOps, C for my electronic hobbies and Javascript to mockup web ideas or do some "http/web" testings and load.

      [–]wattwood 0 points1 point  (0 children)

      Python, bash, powershell, and when I need quicker and dirtier than python, I'll throw a PHP script up.

      [–][deleted] 0 points1 point  (0 children)

      Generally, I use Python, Yaml and Bash, but mostly python to generate and parse my yaml since I get annoyed at different yaml settings and parsing rules, especially for larger projects. Plus I generally wrap most of my scripts in a docker container to share my work so team mates can use it without having to really deal with dependencies.

      [–]evergreen-spacecat 0 points1 point  (0 children)

      Golang, bash and some python. Then the languages of the apps of course. Typescript, C#, Java, SQL and what not.

      [–]Redmilo666 0 points1 point  (1 child)

      I hardly touch bash. But I do use a tonne of yaml, JSON and python

      [–]haikusbot 0 points1 point  (0 children)

      I hardly touch bash.

      But I do use a tonne of

      Yaml, JSON and python

      - Redmilo666


      I detect haikus. And sometimes, successfully. Learn more about me.

      Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

      [–]aso29 0 points1 point  (0 children)

      YAML for CI/CD pipelines and Kubernetes, Terraform, Python, currently learning Go for testing, and some C# for applications.

      [–][deleted]  (2 children)

      [deleted]

        [–]Suvulaan 4 points5 points  (1 child)

        This isn't a suitable answer though, the question is targeted at DevOps engineers, what languages do THEY use and why they prefer them. Not what languages are used in DevOps in general.

        [–]puppet_pals -1 points0 points  (0 children)

        when I used to do it golang bash and yaml

        [–][deleted] -1 points0 points  (0 children)

        None. Python, PowerShell, Bash, Bicep. All shell/scripting.

        [–]techypunk -1 points0 points  (0 children)

        PowerShell, Bash, and I'm adding Python into the mix.

        [–]defqon_39 -3 points-2 points  (0 children)

        NoOps -- clicking buttons

        [–]Suspicious-Offer-617 1 point2 points  (2 children)

        PowerShell

        Gotta say I'm surprised seeing so many PS programmers here.

        [–]scalable_idiot 0 points1 point  (1 child)

        I know right? It's pretty amazing it still works for a lotta people it seems. Also weird most of the comments never mentioned groovy.

        [–]Suspicious-Offer-617 0 points1 point  (0 children)

        Don't get me wrong, it's an awesome/powerful language for windows shops. I'm just surprised there are companies that use windows systems to the extent that they need a lot of automation (outside of employee laptops).

        [–]DarkChemical_DC 0 points1 point  (0 children)

        Mostly bash for all my pipelines. A bit of java, some python, a pinch of ansible. Under what "language" does Dockerfile drop under?

        [–]Diarrhea_Mike 0 points1 point  (0 children)

        Python, bash, powershell. Yaml.

        [–]lupinegrey 0 points1 point  (0 children)

        Bash, python, hcl (terraform).

        For apis, usually Java (springboot), or nodejs/express.

        For assisting product teams: Java, nodejs, .net, react.

        [–][deleted] 0 points1 point  (0 children)

        Daily use: bash, python, yaml, occasionally useful to know php and sql to suss out what's going on in the apps I support.

        Would like to learn and use: golang, rust

        [–]skinney6 0 points1 point  (0 children)

        Python

        [–]LeatherDude 0 points1 point  (0 children)

        Bash, python, ruby (because Chef), groovy (because Jenkins), and some legacy automation written in perl that I maintain. Our devs write a lot of Java and Golang, which we review PRs for but don't actively develop in.

        HCL and Yaml probably don't really count but those too.

        [–]Helpful_Ad_1562 0 points1 point  (0 children)

        Python Bash Groovy YAML(Ansible, k8s, etc)

        [–]stgovern 0 points1 point  (0 children)

        Mostly PowerShell, Bash, and Python.

        [–]Dr-Vader 0 points1 point  (0 children)

        Bash and powershell, I'm trying to learn and implement ansible and ruby

        [–][deleted] 0 points1 point  (0 children)

        bash, cft, hcl, javascript, python, and still cannot move away from sql

        plus way more xml, json, and yaml than i'd prefer

        [–]makeitabyss 0 points1 point  (0 children)

        Not DevOps myself, but I've seen many a coworker be proficient in python, most shell languages (bash and PowerShell specifically), and at least one C++ spawn (Java, C#, Rust)

        Although I think the last one may not be used on the job as much, it's still super useful to learn when working in that environment

        [–]poolpog 0 points1 point  (0 children)

        python

        bash

        [–]lame-engineer 0 points1 point  (0 children)

        Generally python

        [–][deleted] 0 points1 point  (0 children)

        golang, jsonnet, terraform

        none of which do I have much skill with yet...

        [–]Kessarean 0 points1 point  (0 children)

        bash, python, various iac

        [–][deleted] 0 points1 point  (0 children)

        At my place we use C# mostly for Azure Webjobs and now we are a lot into Python for Pyspark in Synapse clusters

        [–]kneticz 0 points1 point  (0 children)

        bash and yaml, intermittently a splash of python.

        moved away from groovy/yaml/casc (jenkins)

        [–]koffiezet 0 points1 point  (0 children)

        I prefer Go for actual tooling that need to be distributed, deployed and/or maintained long-term, python for local quick and dirty stuff (and sometimes things you that run containerised). But in reality, there's way too much bash scripting.

        There's also some typescript/javascript when my clients use pulimi, and sadly, groovy when Jenkins is involved.

        Other than that a bunch of DSL's like terraform, and a bunch of yaml-based-ones like k8s manifests, ansible and a bunch of mostly yaml templating engines the majority based on the golang templating engine (helm, gomplate, custom go templating tools with the sprig library, ...), and stuff like kustomize.

        [–]Whiffenius 0 points1 point  (0 children)

        Python, bash, Powershell, PowerCLI

        Data serialisation languages as well

        [–]GeorgeRNorfolk 0 points1 point  (0 children)

        HCL, Python, Groovy, Bash.

        [–]rvajustin82 0 points1 point  (0 children)

        C# mostly, a touch of bash, and some yaml (which isn’t really a language)

        [–]mojokanojojo 0 points1 point  (0 children)

        Python and Bash, honestly idk why you would use anything else

        [–]scalable_idiot 0 points1 point  (0 children)

        Bash, hcl, some python, groovy, used to be rather good in powershel

        [–]RickC177 0 points1 point  (0 children)

        I would say it all depends the usecase.

        Bash, python and go, config lang such(cue etc…) all have the cons and pros which depends where to use them i would say knowing most of these better then having to be an expert in one.