Skip to content

Commit

Permalink
Merge pull request #12 from blockopsnetwork/update-image
Browse files Browse the repository at this point in the history
update docker image
  • Loading branch information
haroldsphinx authored Mar 26, 2024
2 parents 10c4228 + b5672b7 commit 46d58a7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 140 deletions.
16 changes: 8 additions & 8 deletions cmd/telescope/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ FROM public.ecr.aws/ubuntu/ubuntu:mantic

#Username and uid for grafana-agent user
ARG UID=473
ARG USERNAME="grafana-agent"
ARG USERNAME="telescope"

LABEL org.opencontainers.image.source="https://github.com/grafana/agent"
LABEL org.opencontainers.image.source="https://github.com/blockopsnetwork/telescope"

# Install dependencies needed at runtime.
RUN <<EOF
Expand All @@ -45,15 +45,15 @@ RUN <<EOF
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EOF

COPY --from=build /src/agent/build/grafana-agent /bin/grafana-agent
COPY cmd/grafana-agent/agent-local-config.yaml /etc/agent/agent.yaml
COPY --from=build /src/agent/build/telescope /bin/telescope
COPY cmd/telescope/agent-local-config.yaml /etc/telescope/telescope.yaml

# Create grafana-agent user in container, but do not set it as default
RUN groupadd --gid $UID $USERNAME
RUN useradd -m -u $UID -g $UID $USERNAME
RUN chown -R $USERNAME:$USERNAME /etc/agent
RUN chown -R $USERNAME:$USERNAME /bin/grafana-agent
RUN chown -R $USERNAME:$USERNAME /etc/telescope
RUN chown -R $USERNAME:$USERNAME /bin/telescope

ENTRYPOINT ["/bin/grafana-agent"]
ENTRYPOINT ["/bin/telescope"]
ENV AGENT_DEPLOY_MODE=docker
CMD ["--config.file=/etc/agent/agent.yaml", "--metrics.wal-directory=/etc/agent/data"]
CMD ["--config.file=/etc/telescope/telescope.yaml", "--metrics.wal-directory=/etc/telescope/data"]
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AMBER='\033[0;33m'
BWHITE='\033[1;37m'
NC='\033[0m'

TELESCOPE_IMAGE=grafana/agent:v0.37.2
TELESCOPE_IMAGE=blockopsnetwork/telescope:v0.1.0
TELESCOPE_DIR="/tmp/.telescope"


Expand Down Expand Up @@ -118,7 +118,7 @@ function create_config_dir () {
function create_config_file () {
create_config_dir
echo -n "Creating configuration file... "
TELESCOPE_CONFIG_FILE="${TELESCOPE_DIR}/agent.yaml"
TELESCOPE_CONFIG_FILE="${TELESCOPE_DIR}/telescope.yaml"

if [[ -f "${TELESCOPE_CONFIG_FILE}" ]]; then
warning "Configuration file already exists. Skipping."
Expand Down Expand Up @@ -236,7 +236,7 @@ function run_telescope () {
-e REMOTE_WRITE_URL=${REMOTE_WRITE_URL} \
-e TELESCOPE_USERNAME=${TELESCOPE_USERNAME} \
-e TELESCOPE_PASSWORD=${TELESCOPE_PASSWORD} \
"${TELESCOPE_IMAGE}" --config.file=/etc/agent-config/agent.yaml -config.expand-env
"${TELESCOPE_IMAGE}" --config.file=/etc/telescope/telescope.yaml -config.expand-env
if [[ 0 -ne $? ]]
then
error "Failed to create the docker container."
Expand Down
35 changes: 5 additions & 30 deletions tools/ci/docker-containers
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ export TARGET_CONTAINER=${1:-}
export DRONE_TAG=${DRONE_TAG:-}
export DRONE_BRANCH=${DRONE_BRANCH:-}

export AGENT_IMAGE=grafana/agent
export AGENT_BORINGCRYPTO_IMAGE=grafana/agent-boringcrypto
export AGENTCTL_IMAGE=grafana/agentctl
export OPERATOR_IMAGE=grafana/agent-operator
export AGENT_IMAGE=blockopsnetwork/telescope
export OPERATOR_IMAGE=blockopsnetwork/telescope-operator

# We need to determine what version to assign to built binaries. If containers
# are being built from a Drone tag trigger, we force the version to come from the
Expand Down Expand Up @@ -62,30 +60,7 @@ case "$TARGET_CONTAINER" in
--build-arg VERSION="$VERSION" \
-t "$AGENT_IMAGE:$VERSION" \
-t "$AGENT_IMAGE:$BRANCH_TAG" \
-f cmd/grafana-agent/Dockerfile \
.
;;

agent-boringcrypto)
docker buildx build --push \
--platform $BUILD_PLATFORMS_BORINGCRYPTO \
--build-arg RELEASE_BUILD=1 \
--build-arg VERSION="$VERSION" \
--build-arg GOEXPERIMENT=boringcrypto \
-t "$AGENT_BORINGCRYPTO_IMAGE:$VERSION" \
-t "$AGENT_BORINGCRYPTO_IMAGE:$BRANCH_TAG" \
-f cmd/grafana-agent/Dockerfile \
.
;;

agentctl)
docker buildx build --push \
--platform $BUILD_PLATFORMS \
--build-arg RELEASE_BUILD=1 \
--build-arg VERSION="$VERSION" \
-t "$AGENTCTL_IMAGE:$VERSION" \
-t "$AGENTCTL_IMAGE:$BRANCH_TAG" \
-f cmd/grafana-agentctl/Dockerfile \
-f cmd/telescope/Dockerfile \
.
;;

Expand All @@ -96,12 +71,12 @@ case "$TARGET_CONTAINER" in
--build-arg VERSION="$VERSION" \
-t "$OPERATOR_IMAGE:$VERSION" \
-t "$OPERATOR_IMAGE:$BRANCH_TAG" \
-f cmd/grafana-agent-operator/Dockerfile \
-f cmd/telescope-operator/Dockerfile \
.
;;

*)
echo "Usage: $0 agent|agent-boringcrypto|agentctl|agent-operator"
echo "Usage: $0 agent|agent-operator"
exit 1
;;
esac
Expand Down
99 changes: 0 additions & 99 deletions tools/ci/docker-containers-windows

This file was deleted.

0 comments on commit 46d58a7

Please sign in to comment.