Skip to content

Commit

Permalink
feat(ci): promtail cross platform
Browse files Browse the repository at this point in the history
Build promtail on linux and windows, discard artifacts
  • Loading branch information
sh0rez authored and Ed committed Jun 6, 2019
1 parent 421265c commit ba54f51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ jobs:
- checkout
- setup_remote_docker

- run:
name: Promtail cross platform
command: |
touch loki-build-image/.uptodate &&
make GOOS=linux BUILD_IN_CONTAINER=false cmd/promtail/promtail
rm cmd/promtail/promtail
make GOOS=windows BUILD_IN_CONTAINER=false cmd/promtail/promtail
- run:
name: Build Images
command: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ clean:

assets:
@echo ">> writing assets"
go generate -x -v ./pkg/promtail/server/ui
GOOS=$(shell go env GOHOSTOS) go generate -x -v ./pkg/promtail/server/ui

check_assets: assets
@echo ">> checking that assets are up-to-date"
Expand Down

4 comments on commit ba54f51

@Enrique-i
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi,

a question, does this WA solve this problem?

PS C:\Users\enriq\docker-kike\LOKI\opt\loki> docker-compose -f loki-stack.yml up
ERROR: .FileNotFoundError: [Errno 2] No such file or directory: '.\loki-stack.yml'
PS C:\Users\enriq\docker-kike\LOKI\opt\loki>
PS C:\Users\enriq\docker-kike\LOKI\opt\loki> docker-compose -f loki-compose.yml up
Creating network "loki_loki" with the default driver
Creating loki_grafana_1 ...
Creating loki_loki_1 ...
Creating loki_grafana_1 ... done Creating loki_loki_1 ... done ERROR: for loki_promtail_1 Cannot create container for service promtail: invalid volume specification: '/var/log:/var/log:rw'

ERROR: for promtail Cannot create container for service promtail: invalid volume specification: '/var/log:/var/log:rw'
ERROR: Encountered errors while bringing up the project.

BR

@cyriltovena
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No your problem is just that the docker-compose file is for mac and linux, you need to modify the mount path and use a windows style path.

Something like:

version: "3"

networks:
  loki:

services:
  loki:
    image: grafana/loki:latest
    ports:
      - "3100:3100"
    command: -config.file=/etc/loki/local-config.yaml
    networks:
      - loki

  promtail:
    image: grafana/promtail:latest
    volumes:
      - //c/path/to/logs:`/var/log`
    command: -config.file=/etc/promtail/docker-config.yaml
    networks:
      - loki

  grafana:
    image: grafana/grafana:master
    ports:
      - "3000:3000"
    networks:
      - loki

replace //c/path/to/logs with a path where there is log files ending with .log.

@Enrique-i
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi cyriltovena,
thanks for response.

my folder in windows is " //c/users/enriq/docker-kike/logs-cmm ", but still can't create the volume

PS C:\Users\enriq\docker-kike> docker-compose -f grafana-loki-promtail.yml up
Starting docker-kike_grafana_1 ...
docker-kike_loki_1 is up-to-date
Creating docker-kike_promtail_1 ... error
Starting docker-kike_grafana_1 ... done ar/log:rw'

ERROR: for promtail Cannot create container for service promtail: invalid volume specification: '//c/users/enriq/docker-kike/logs-cmm:/var/log:rw'
ERROR: Encountered errors while bringing up the project.

BR

@cyriltovena
Copy link
Contributor

@cyriltovena cyriltovena commented on ba54f51 Apr 1, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.