Skip to content
Snippets Groups Projects
  • Jonas Theis's avatar
    14948393
    Integration tests (#312) · 14948393
    Jonas Theis authored
    * Add docker compose for running integration tests.
    Runs entry_node and arbitrary number of peers in docker network
    
    * Fix permission denied in container if run without mounting a `rw` volume making it possible to run as throw-away container.
    Remove `VOLUME` from Dockerfile as this only pollutes host system with anonymous volumes.
    
    * Use named network for easier external use
    
    * Add test container that discovers peers and waits for autopeering to happen
    
    * Fix min waitForNeighbors
    
    * Add go.sum
    
    * Run integration tests with Github Actions
    
    * Added framework that abstracts the docker network and provides convenience functionality
    
    * Update directory in Github Actions
    
    * Add bash script for automated local test execution
    
    * Add getMessageByHash endpoint
    
    * Adjust to merge changes
    
    * Add methods to easily do HTTP POST requests
    
    * Added relay message test
    
    * Increase client timeout
    
    * Verbose output for tests makes it easier to follow the execution
    
    * Introduce small API wrapper for GoShimmer HTTP API
    
    * Adjust relay test to use new API wrapper
    
    * WIP: Docker logs
    
    * Fix issue with serving visualizer analysis server of entry node
    
    * Persist logs of containers after CI run
    
    * Fix test file
    
    * Fix uploading of artifacts
    
    * Save all containers' logs as artifacts
    
    * Create logs files also with local run
    
    * Add possibility to retrieve logs from a peer via Docker logs
    
    * Make tester part of the goshimmer module to make code sharing possible
    
    * Use client/lib to make HTTP requests in tester
    
    * Fix unit test directory
    
    * Add comments/doc to the code
    
    * Add readme
    
    * Move tester to own module and don't build container but use existing golang one instead
    
    * Address PR comments
    
    * Adjust to merge
    
    * Only use 1 config file for all containers
    
    * go mod tidy
    
    * Rename client lib base url
    Integration tests (#312)
    Jonas Theis authored
    * Add docker compose for running integration tests.
    Runs entry_node and arbitrary number of peers in docker network
    
    * Fix permission denied in container if run without mounting a `rw` volume making it possible to run as throw-away container.
    Remove `VOLUME` from Dockerfile as this only pollutes host system with anonymous volumes.
    
    * Use named network for easier external use
    
    * Add test container that discovers peers and waits for autopeering to happen
    
    * Fix min waitForNeighbors
    
    * Add go.sum
    
    * Run integration tests with Github Actions
    
    * Added framework that abstracts the docker network and provides convenience functionality
    
    * Update directory in Github Actions
    
    * Add bash script for automated local test execution
    
    * Add getMessageByHash endpoint
    
    * Adjust to merge changes
    
    * Add methods to easily do HTTP POST requests
    
    * Added relay message test
    
    * Increase client timeout
    
    * Verbose output for tests makes it easier to follow the execution
    
    * Introduce small API wrapper for GoShimmer HTTP API
    
    * Adjust relay test to use new API wrapper
    
    * WIP: Docker logs
    
    * Fix issue with serving visualizer analysis server of entry node
    
    * Persist logs of containers after CI run
    
    * Fix test file
    
    * Fix uploading of artifacts
    
    * Save all containers' logs as artifacts
    
    * Create logs files also with local run
    
    * Add possibility to retrieve logs from a peer via Docker logs
    
    * Make tester part of the goshimmer module to make code sharing possible
    
    * Use client/lib to make HTTP requests in tester
    
    * Fix unit test directory
    
    * Add comments/doc to the code
    
    * Add readme
    
    * Move tester to own module and don't build container but use existing golang one instead
    
    * Address PR comments
    
    * Adjust to merge
    
    * Only use 1 config file for all containers
    
    * go mod tidy
    
    * Rename client lib base url
Dockerfile 1.24 KiB
############################
# Build
############################
# golang:1.14.0-buster
FROM golang@sha256:fc7e7c9c4b0f6d2d5e8611ee73b9d1d3132750108878517bbf988aa772359ae4 AS build

# Ensure ca-certficates are up to date
RUN update-ca-certificates

# Set the current Working Directory inside the container
RUN mkdir /goshimmer
WORKDIR /goshimmer

# Use Go Modules
COPY go.mod .
COPY go.sum .

ENV GO111MODULE=on
RUN go mod download
RUN go mod verify

# Copy everything from the current directory to the PWD(Present Working Directory) inside the container
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
      -ldflags='-w -s -extldflags "-static"' -a \
       -o /go/bin/goshimmer

############################
# Image
############################
# using static nonroot image
# user:group is nonroot:nonroot, uid:gid = 65532:65532
FROM gcr.io/distroless/static@sha256:23aa732bba4c8618c0d97c26a72a32997363d591807b0d4c31b0bbc8a774bddf

EXPOSE 14666/tcp
EXPOSE 14626/udp

# Copy the Pre-built binary file from the previous stage
COPY --from=build /go/bin/goshimmer /run/goshimmer
# Copy the default config
COPY config.default.json /config.json

ENTRYPOINT ["/run/goshimmer", "--config-dir=/", "--database.directory=/tmp/mainnetdb"]