#Private deps support

1 messages · Page 1 of 1 (latest)

static breach
#

This PR cover a few changes:

  • Add support to fetch gitconfig from user's host system.
  • Add support for SDK Config in the engine.
  • Add support for configuring GOPRIVATE env variable (by leveraging the new ^^ sdk config feature) for Go SDK
#

Add support to fetch gitconfig from user's host system.

  • Currently we only fetch use this url instead of this type gitconfig.
  • We decided not to fetch everything from user's host gitconfig as it can have user's system specific config which can break the engine/module and trigger unexpected behavior and inconsistencies.
  • We can easily add more gitconfig keys if a user requests in future.
  • We need git to be installed on the host system for this to work, but it is optional. We ignore if git is not installed.
#

Add support for SDK Config in the engine.

  • We added a new field sdk.config in dagger.json.
  • This is an object (map[string]interface{})
  • moduleSDK can define a WithConfig function. If the function exists, we verify the arguments against the keys specified in sdk.config object.
  • We error out if there is a key in sdk.config, which is not supported by SDK
  • We use default value (as defined in WithConfig function) by doing introspection on it IF no override is provided in sdk.config object in dagger.json
  • The support for this is already added in Go SDK (currently only has one config goprivate, which sets the GOPRIVATE env variable in the codegen container.
  • I have some changes in a branch for typescript SDK, but it needs more changes. I will talk a bit more about it in one of the next msg.
#

Add support for private dependencies in golang sdk

  • We leverage the above two features to support private deps in golang based modules.
  • The user can now set sdk.config.goprivate in dagger.json, which gets translated to GOPRIVATE env variable in the codegen container.
#

Add support for custom config in typescript sdk

  • This is a WIP right now as it involves quite a bit of refactoring of typescript SDK to ensure the sdk.config could be used in the SDK.
  • Some of the changes involve the configs that we pass using package.json properties today. e.g. runtime etc.
  • For this to work we need to restructure the sdk so that
    • sdk provides a base image (currently this requires some config from package.json)
    • we add our customizations on top of that base image (e.g. SSH Auth Sock and configs from sdk.config
  • The sdk then runs codegen on that container and use that as runtime.
  • I might be oversimplifying the steps here, but that is basically it.
  • I have a WIP branch that I will rebase and cleanup and open PR for review.
#

I am adding above to the GitHub PR as well so that we can keep track of what changed in that PR.

jagged ruin
#

cc @tired quail any chance you can help scope the docs changes here?

#

@static breach this is a good summary, but I would really like to make sure that we don't leave this feature undocumented and just in github/discord.
it's a pretty cool feature that enterprise folks have asked for, so I think having some basic docs on how to configure it would be super valuable

#

(this was on my mind this morning, since i was adding this to the changelog, and noticed we don't have docs to point to for it)

#

another follow-up note. it looks like we're only the gitconfig injection into go riiiight?

static breach
#

right.. getting this into a meaningful place (before codegen) needs restructuring of the typescript sdk (I got this working, but it is quite some changes, so I wanted to do a separate PR for it)

#

including the typescript sdk config support....

#

I can take a stab at adding the docs.. let me search in docs where it would make sense and write something up

tired quail
#

so we're sure about not forgetting anything and finding the right place for that

#

re: other SDK's support for this. Do you think we should make it happen right away @jagged ruin ?

jagged ruin
#

yes pls! 🙏

#

i would like to make sure we have support for this across at least our core sdks