Skip to content

Commit 7e53488

Browse files
skudasovdavidcauchi
authored andcommitted
dlv from flag, fix promtail logs (#1488)
1 parent 862ead4 commit 7e53488

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

book/src/framework/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
| CTF_IGNORE_CRITICAL_LOGS | Ignore all logs that has CRIT,FATAL or PANIC levels (Chainlink nodes only!) | `true`, `false` | `false` | 🚫 |
1111
| CTF_CHAINLINK_IMAGE | Flag to override Chainlink Docker image in format $repository:$tag | $repository:$tag | - | 🚫 |
1212
| CTF_JD_IMAGE | Job distributor service image in format $repository:$tag | $repository:$tag | - | 🚫 |
13+
| CTF_CLNODE_DLV | Use debug entrypoint to allow Delve debugger connection, works only with "plugins" image of CL node | `true`, `false` | `false` | 🚫 |
1314
| LOKI_URL | URL to `Loki` push api, should be like`${host}/loki/api/v1/push` | URL | `http://host.docker.internal:3030/loki/api/v1/push` | 🚫 |
1415
| LOKI_TENANT_ID | Streams all components logs to `Loki`, see params below | `string` | `promtail` | 🚫 |
1516
| LOKI_BASIC_AUTH | Basic auth in format $user:$password | `$user:$password` | - | 🚫 |

framework/.changeset/v0.3.9.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Dlv from original image
2+
- Fix logs for promtail

framework/docker.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ func WriteAllContainersLogs(dir string) error {
264264
func BuildImageOnce(once *sync.Once, dctx, dfile, nameAndTag string) error {
265265
var err error
266266
once.Do(func() {
267-
dfilePath := filepath.Join(dctx, dfile)
268-
err = runCommand("docker", "build", "-t", nameAndTag, "-f", dfilePath, dctx)
267+
err = BuildImage(dctx, dfile, nameAndTag)
269268
if err != nil {
270269
err = fmt.Errorf("failed to build Docker image: %w", err)
271270
}
@@ -275,5 +274,9 @@ func BuildImageOnce(once *sync.Once, dctx, dfile, nameAndTag string) error {
275274

276275
func BuildImage(dctx, dfile, nameAndTag string) error {
277276
dfilePath := filepath.Join(dctx, dfile)
278-
return runCommand("docker", "build", "-t", nameAndTag, "-f", dfilePath, dctx)
277+
if os.Getenv("CTF_CLNODE_DLV") == "true" {
278+
return runCommand("docker", "build", "--build-arg", `GO_GCFLAGS=all=-N -l`, "-t", nameAndTag, "-f", dfilePath, dctx)
279+
} else {
280+
return runCommand("docker", "build", "-t", nameAndTag, "-f", dfilePath, dctx)
281+
}
279282
}

framework/promtail.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ scrape_configs:
5959
lokiTenantID := os.Getenv("LOKI_TENANT_ID")
6060

6161
if lokiURL == "" {
62-
lokiURL = "http://host.docker.internal:3100/loki/api/v1/push"
62+
lokiURL = "http://host.docker.internal:3030/loki/api/v1/push"
6363
}
6464
if lokiTenantID == "" {
6565
lokiTenantID = "promtail"

0 commit comments

Comments
 (0)