Giter Site home page Giter Site logo

Include psql? about cimg-base HOT 2 CLOSED

circleci-public avatar circleci-public commented on July 18, 2024
Include psql?

from cimg-base.

Comments (2)

nashbridges avatar nashbridges commented on July 18, 2024

Current recommended approach is to install psql on each run with a manual command

- run: sudo apt install -y postgresql-client || true

or with a 3rd party orb.

Side note

The suggested command should be updated to

- run: sudo apt-get update && sudo apt install -y postgresql-client

Otherwise

a) it fails with the "E: Unable to locate package postgresql-client" error
b) when it fails it does not stop the build

Both approaches (the manual one and with the orb) have the same drawbacks:

  1. they don't benefit from Docker's fs caching. That means more HTTP requests are made, and every request can potentially fail the build due to a network error
  2. they spend CircleCI credits (which is especially important for public repos with free credits)

The alternative (which is also mentioned in the docs) is to maintain and host your own Docker image with psql preinstalled. Although it does not have the drawbacks from above, it requires a significant amount of effort from devs. I assume that was the main reason for #61 ("we want something that works").

I do understand that you can not satisfy every dev in the world, but perhaps the top X popular databases?

An alternative to put everything into one base image would be to have the "-pg", "-mysql" etc prefixes similar to existing "-node" (although I understand it will boost the number of image variations).

from cimg-base.

gmemstr avatar gmemstr commented on July 18, 2024

I'll let @felicianotech speak further/correct me on this, but initial reaction is that this is something better kept in either the config using apt get, or a custom Docker image. While I can see the upside of adding psql to the base image, we would also include the other clients, which I'm unsure is something we'd want to do. Creating variants doesn't feel quite right either.

I would argue that maintaining a Docker image based on cimg/base with specific dependencies is a much less brittle way of including them within your pipelines, since you'll have full control over the version of dependencies installed (say you rely on cimg/base:stable-pg, and there's a breaking change to postgres for whatever reason and we upgrade). Curious what you mean by "significant amount of effort from devs" - unless upgrading or adding a dependency, a Docker image will be pretty low maintenance.

Keeping these images generic enough to fit most use cases while also having the flexibility to be moulded to specific needs is more or less an end goal of our convenience images, and adding SQL/NoSQL clients to the mix might shake that up a bit too much.

from cimg-base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.