Skip to content

feat: Enable StateClients within Docker to connect to destinations#386

Merged
kodiakhq[bot] merged 6 commits intomainfrom
mariano/make-unix-socket-dir-public
Aug 8, 2024
Merged

feat: Enable StateClients within Docker to connect to destinations#386
kodiakhq[bot] merged 6 commits intomainfrom
mariano/make-unix-socket-dir-public

Conversation

@marianogappa
Copy link
Copy Markdown
Contributor

@marianogappa marianogappa commented Aug 6, 2024

StateClients open a connection to destinations directly in order to read & persist state. This doesn't work if the source plugin is in a docker container, because docker containers cannot mount sockets (they can mount the files, but the communication doesn't work).

This PR makes two simple changes:

  • Adds the WithUseTCP option to the client constructor. If it ends up using startLocal (as most plugins do), it will send an --address with a free TCP address, rather than the default of a Unix socket. Some code is updated to be consistent with this change.
  • For Docker registries, it always enables the special extra host host.docker.internal, so that the container can address the host's destination connection. There's no good way of asking if the source plugin has a StateClient, so this minimal change will apply to all docker syncs.

By itself, this PR shouldn't change anything. I'll open a minimal PR on the cli to leverage this.

I've tested a Docker sync (typeform) and a non-Docker sync (aws) with these changes and cli changes and they work fine
Screenshot 2024-08-08 at 12 45 17
Screenshot 2024-08-08 at 12 45 49

@github-actions github-actions Bot added the feat label Aug 6, 2024
@erezrokah erezrokah changed the title feat: make unitSockerDir public. feat: Make unitSockerDir public. Aug 6, 2024
@github-actions github-actions Bot added feat and removed feat labels Aug 6, 2024
@marianogappa marianogappa force-pushed the mariano/make-unix-socket-dir-public branch from 94c6cdf to d0415a5 Compare August 6, 2024 14:52
@marianogappa marianogappa changed the title feat: Make unitSockerDir public. feat: Enable StateClients within Docker to connect to destinations Aug 8, 2024
@github-actions github-actions Bot added feat and removed feat labels Aug 8, 2024
@marianogappa marianogappa marked this pull request as ready for review August 8, 2024 11:59
@marianogappa marianogappa requested review from a team and erezrokah and removed request for a team August 8, 2024 11:59
@github-actions github-actions Bot added feat and removed feat labels Aug 8, 2024
@marianogappa marianogappa requested a review from erezrokah August 8, 2024 13:33
@marianogappa marianogappa added the automerge Add to automerge PRs once requirements are met label Aug 8, 2024
@kodiakhq kodiakhq Bot merged commit da98954 into main Aug 8, 2024
@kodiakhq kodiakhq Bot deleted the mariano/make-unix-socket-dir-public branch August 8, 2024 14:04
kodiakhq Bot pushed a commit that referenced this pull request Aug 9, 2024
🤖 I have created a release *beep* *boop*
---


## [1.22.0](v1.21.5...v1.22.0) (2024-08-08)


### Features

* Enable StateClients within Docker to connect to destinations ([#386](#386)) ([da98954](da98954))


### Bug Fixes

* **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.7 ([#387](#387)) ([790f62e](790f62e))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Add to automerge PRs once requirements are met feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants