-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Add package command #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ad0f442
bf08173
ae1af6e
896a7d9
f768597
a21a6ed
b71b807
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM python:3.11-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy the code and install dependencies | ||
| COPY requirements.txt . | ||
| COPY setup.cfg . | ||
| COPY setup.py . | ||
| COPY cloudquery cloudquery | ||
| COPY main.py . | ||
| RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
|
||
| EXPOSE 7777 | ||
|
|
||
| ENTRYPOINT ["python3", "main.py"] | ||
|
|
||
| CMD ["serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,10 +29,32 @@ class SyncOptions: | |
| backend_options: BackendOptions = None | ||
|
|
||
|
|
||
| @dataclass | ||
| class BuildTarget: | ||
| os: str = None | ||
| arch: str = None | ||
|
|
||
|
|
||
| @dataclass | ||
| class Options: | ||
| dockerfile: str = None | ||
| build_targets: List[BuildTarget] = None | ||
| team: str = None | ||
| kind: str = None | ||
|
|
||
|
|
||
| class Plugin: | ||
| def __init__(self, name: str, version: str) -> None: | ||
| def __init__(self, name: str, version: str, opts: Options = None) -> None: | ||
| self._name = name | ||
| self._version = version | ||
| self._opts = Options() if opts is None else opts | ||
| if self._opts.dockerfile is None: | ||
| self._opts.dockerfile = "Dockerfile" | ||
| if self._opts.build_targets is None: | ||
| self._opts.build_targets = [ | ||
| BuildTarget("linux", "amd64"), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This matches our current supported platforms https://github.com/cloudquery/cloudquery/blob/d76f083b5027efd579d1432f59c1d8955182d0a1/.github/workflows/release_plugin.yml#L93
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want Darwin targets as defaults? A lot of people do development on Macs (including us).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe you can still run Linux images on MacOS. For example Node.js images has only Linux platform: |
||
| BuildTarget("linux", "arm64"), | ||
| ] | ||
|
|
||
| def init(self, spec: bytes, no_connection: bool = False) -> None: | ||
| pass | ||
|
|
@@ -46,6 +68,18 @@ def name(self) -> str: | |
| def version(self) -> str: | ||
| return self._version | ||
|
|
||
| def team(self) -> str: | ||
| return self._opts.team | ||
|
|
||
| def kind(self) -> str: | ||
| return self._opts.kind | ||
|
|
||
| def dockerfile(self) -> str: | ||
| return self._opts.dockerfile | ||
|
|
||
| def build_targets(self) -> List[BuildTarget]: | ||
| return self._opts.build_targets | ||
|
|
||
| def get_tables(self, options: TableOptions) -> List[Table]: | ||
| raise NotImplementedError() | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,6 +151,8 @@ def filter_dfs_func(tt: List[Table], include, exclude, skip_dependent_tables: bo | |
| filtered_tables = [] | ||
| for t in tt: | ||
| filtered_table = copy.deepcopy(t) | ||
| for r in filtered_table.relations: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to cloudquery/cloudquery#14637. |
||
| r.parent = filtered_table | ||
| filtered_table = _filter_dfs_impl( | ||
| filtered_table, False, include, exclude, skip_dependent_tables | ||
| ) | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a Docker file so we can package the MemDB plugin in the tests