Skip to content

Commit 4b05693

Browse files
authored
Merge pull request #5893 from opsmill/jbr-docker-collect-new-version
debug collect in docker image
2 parents 0af8355 + e959e1d commit 4b05693

File tree

7 files changed

+524
-200
lines changed

7 files changed

+524
-200
lines changed

development/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ RUN mkdir /prom_shared /remote
1515

1616
RUN apt-get update && \
1717
apt-get upgrade -y && \
18-
apt-get install --no-install-recommends -y tini curl git pkg-config build-essential ca-certificates && \
18+
apt-get install --no-install-recommends -y tini curl git pkg-config build-essential ca-certificates gnupg2 && \
19+
install -m 0755 -d /etc/apt/keyrings && \
20+
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
21+
chmod a+r /etc/apt/keyrings/docker.gpg && \
22+
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
23+
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
24+
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
25+
apt-get update && \
26+
apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
1927
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.5 python3 - && \
2028
apt-get autoremove -y && \
2129
apt-get clean all && \

tasks/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from invoke import Collection, Context, task
44

5-
from . import backend, demo, dev, docs, main, performance, release, schema, sdk
5+
from . import backend, bundle, demo, dev, docs, main, performance, release, schema, sdk
66
from .utils import ESCAPED_REPO_PATH
77

88
ns = Collection()
@@ -11,6 +11,7 @@
1111
ns.add_collection(docs)
1212
ns.add_collection(performance)
1313
ns.add_collection(backend)
14+
ns.add_collection(bundle)
1415
ns.add_collection(demo)
1516
ns.add_collection(main)
1617
ns.add_collection(schema)

tasks/bundle.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from __future__ import annotations
2+
3+
import os
4+
from typing import TYPE_CHECKING
5+
6+
from invoke.tasks import task
7+
8+
from .container_ops import (
9+
collect_support_data,
10+
)
11+
from .shared import (
12+
INFRAHUB_DATABASE,
13+
Namespace,
14+
)
15+
16+
if TYPE_CHECKING:
17+
from invoke.context import Context
18+
19+
NAMESPACE = Namespace.DEFAULT
20+
21+
22+
@task(optional=["database"])
23+
def collect(
24+
context: Context,
25+
database: str = INFRAHUB_DATABASE,
26+
include_queries: bool = False,
27+
project: str | None = None,
28+
log_lines: int | None = None,
29+
) -> None:
30+
"""Collect all logs and create a support archive."""
31+
if project:
32+
os.environ["INFRAHUB_BUILD_NAME"] = project
33+
34+
print("Discovering InfraHub projects...")
35+
collect_support_data(
36+
context=context, database=database, namespace=NAMESPACE, include_queries=include_queries, log_lines=log_lines
37+
)

0 commit comments

Comments
 (0)