Skip to content
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

misc: move cmd/alloy to root of repository #77

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ steps:
path: /var/run/docker.sock
trigger:
paths:
- cmd/alloy/Dockerfile
- Dockerfile
- tools/ci/docker-containers
ref:
- refs/heads/main
Expand All @@ -109,7 +109,7 @@ steps:
path: //./pipe/docker_engine/
trigger:
paths:
- cmd/alloy/Dockerfile.windows
- Dockerfile.windows
- tools/ci/docker-containers-windows
ref:
- refs/heads/main
Expand Down Expand Up @@ -401,6 +401,6 @@ kind: secret
name: updater_private_key
---
kind: signature
hmac: 1a44f5bcd0f52805d4b7d1f11433f993832627118bbae3956fe5aa49b68d5a31
hmac: 1c75c3c155d1dba9707728f7b6a5fed9399518900e86c7fba55e52a253bdb26b

...
4 changes: 2 additions & 2 deletions .drone/pipelines/check_containers.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ local build_image = import '../util/build_image.jsonnet';
local pipelines = import '../util/pipelines.jsonnet';

local linux_containers = [
{ name: 'grafana/alloy', make: 'make alloy-image', path: 'cmd/alloy/Dockerfile' },
{ name: 'grafana/alloy', make: 'make alloy-image', path: 'Dockerfile' },
];

local windows_containers = [
{ name: 'grafana/alloy', argument: 'alloy', path: 'cmd/alloy/Dockerfile.windows' },
{ name: 'grafana/alloy', argument: 'alloy', path: 'Dockerfile.windows' },
];

(
Expand Down
2 changes: 1 addition & 1 deletion cmd/alloy/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN <<EOF
EOF

COPY --from=build /src/alloy/build/alloy /bin/alloy
COPY cmd/alloy/example-config.river /etc/alloy/config.river
COPY example-config.river /etc/alloy/config.river

# Create alloy user in container, but do not set it as default
RUN groupadd --gid $UID $USERNAME
Expand Down
2 changes: 1 addition & 1 deletion cmd/alloy/Dockerfile.windows → Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN ""C:\Program Files\git\bin\bash.exe" -c "go clean -cache -modcache""
FROM mcr.microsoft.com/windows/nanoserver:1809

COPY --from=builder /src/alloy/build/alloy /bin/alloy
COPY --from=builder /src/alloy/cmd/alloy/example-config.river /etc/alloy/config.river
COPY --from=builder /src/alloy/example-config.river /etc/alloy/config.river

ENTRYPOINT ["/bin/alloy"]
CMD ["run", "/etc/alloy/config.river", "--storage.path=/etc/alloy/data"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
## Targets for building binaries:
##
## binaries Compiles all binaries.
## alloy Compiles cmd/alloy to $(ALLOY_BINARY)
## alloy Compiles Alloy to $(ALLOY_BINARY)
## alloy-service Compiles internal/cmd/alloy-service to $(SERVICE_BINARY)
##
## Targets for building Docker images:
Expand Down Expand Up @@ -158,7 +158,7 @@ alloy:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
$(GO_ENV) go build $(GO_FLAGS) -o $(ALLOY_BINARY) ./cmd/alloy
$(GO_ENV) go build $(GO_FLAGS) -o $(ALLOY_BINARY) .
endif

# alloy-service is not included in binaries since it's Windows-only.
Expand Down Expand Up @@ -190,7 +190,7 @@ endif
images: alloy-image

alloy-image:
DOCKER_BUILDKIT=1 docker build $(DOCKER_FLAGS) -t $(ALLOY_IMAGE) -f cmd/alloy/Dockerfile .
DOCKER_BUILDKIT=1 docker build $(DOCKER_FLAGS) -t $(ALLOY_IMAGE) -f Dockerfile .

#
# Targets for generating assets
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ compiling and testing your changes do:

```bash
# For building:
go build ./cmd/alloy/
go build .
./alloy -config.file=<config-file>

# For testing:
Expand Down Expand Up @@ -62,7 +62,7 @@ To build Grafana Agent from source code, please install the following tools:

You can directly use the go tool to download and install the agent binary into your GOPATH:

$ GO111MODULE=on go install github.com/grafana/alloy/cmd/alloy
$ GO111MODULE=on go install github.com/grafana/alloy
$ alloy run your_config.river

An example of the above configuration file can be found [here][example-config].
Expand Down Expand Up @@ -205,5 +205,5 @@ a hard fork (i.e., creating a new Go module with the same source).
[CLA]: https://cla-assistant.io/grafana/alloy
[good-first-issue]: https://github.com/grafana/alloy/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
[community-slack]: https://slack.grafana.com/
[example-config]: ../../cmd/alloy/example-config.river
[example-config]: ../../example-config.river
[go-modules]: https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tools/ci/docker-containers
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ case "$TARGET_CONTAINER" in
--build-arg VERSION="$VERSION" \
-t "$ALLOY_IMAGE:$TAG_VERSION" \
-t "$ALLOY_IMAGE:$BRANCH_TAG" \
-f cmd/alloy/Dockerfile \
-f Dockerfile \
.
;;

Expand Down
2 changes: 1 addition & 1 deletion tools/ci/docker-containers-windows
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ case "$TARGET_CONTAINER" in
-t "$ALLOY_IMAGE:$BRANCH_TAG" \
--build-arg VERSION="$VERSION" \
--build-arg RELEASE_BUILD=1 \
-f ./cmd/alloy/Dockerfile.windows \
-f ./Dockerfile.windows \
.
;;

Expand Down
Loading