Skip to content

Commit

Permalink
fix/Simplify docker images (#2446)
Browse files Browse the repository at this point in the history
Closes #2379. Tested with
nspcc-dev/neofs-dev-env#272.
  • Loading branch information
roman-khimov authored Jul 19, 2023
2 parents e5ac376 + 2cb41e1 commit 354fddd
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .docker/Dockerfile.adm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ COPY . /src
RUN make bin/neofs-adm

# Executable image
FROM alpine AS neofs-adm
RUN apk add --no-cache bash
FROM scratch

WORKDIR /

Expand Down
3 changes: 1 addition & 2 deletions .docker/Dockerfile.cli
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ COPY . /src
RUN make bin/neofs-cli

# Executable image
FROM alpine AS neofs-cli
RUN apk add --no-cache bash
FROM scratch

WORKDIR /

Expand Down
4 changes: 2 additions & 2 deletions .docker/Dockerfile.ir
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ COPY . /src
RUN make bin/neofs-ir

# Executable image
FROM alpine AS neofs-ir
RUN apk add --no-cache bash
FROM scratch

WORKDIR /

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/bin/neofs-ir /bin/neofs-ir

CMD ["neofs-ir"]
4 changes: 2 additions & 2 deletions .docker/Dockerfile.storage
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ COPY . /src
RUN make bin/neofs-node

# Executable image
FROM alpine AS neofs-node
RUN apk add --no-cache bash
FROM scratch

WORKDIR /

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/bin/neofs-node /bin/neofs-node

CMD ["neofs-node"]
4 changes: 2 additions & 2 deletions .docker/Dockerfile.storage-testnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ COPY . /src
RUN make bin/neofs-node

# Executable image
FROM alpine AS neofs-node
RUN apk add --no-cache bash
FROM scratch

WORKDIR /

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/bin/neofs-node /bin/neofs-node
COPY --from=builder /src/config/testnet/config.yml /config.yml

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Subnets support has been removed:
- `neoofs-amd morph` does not have `subnet` subcommand anymore.
- `neofs-cli container create` does not have `--subnet` flag anymore.

Docker images now contain a single executable file and SSL certificates only.

`neofs-cli control healthcheck` exit code is `0` only for "READY" state.

## [0.37.0] - 2023-06-15 - Sogado

### Added
Expand Down
17 changes: 15 additions & 2 deletions cmd/neofs-cli/modules/control/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package control

import (
"crypto/ecdsa"
"os"

rawclient "github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
Expand Down Expand Up @@ -60,8 +61,14 @@ func healthCheck(cmd *cobra.Command, _ []string) {

verifyResponse(cmd, resp.GetSignature(), resp.GetBody())

healthStatus := resp.GetBody().GetHealthStatus()

cmd.Printf("Network status: %s\n", resp.GetBody().GetNetmapStatus())
cmd.Printf("Health status: %s\n", resp.GetBody().GetHealthStatus())
cmd.Printf("Health status: %s\n", healthStatus)

if healthStatus != control.HealthStatus_READY {
os.Exit(1)
}
}

func healthCheckIR(cmd *cobra.Command, key *ecdsa.PrivateKey, c *client.Client) {
Expand All @@ -81,5 +88,11 @@ func healthCheckIR(cmd *cobra.Command, key *ecdsa.PrivateKey, c *client.Client)

verifyResponse(cmd, resp.GetSignature(), resp.GetBody())

cmd.Printf("Health status: %s\n", resp.GetBody().GetHealthStatus())
healthStatus := resp.GetBody().GetHealthStatus()

cmd.Printf("Health status: %s\n", healthStatus)

if healthStatus != ircontrol.HealthStatus_READY {
os.Exit(1)
}
}

0 comments on commit 354fddd

Please sign in to comment.