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

chore: Rename slinky=>connect #669

Merged
merged 9 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ Concluson
conditionaltokens
configurator
confixcmd
connectd
consensuskeeper
consensusmodulev
consensustypes
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build:
strategy:
matrix:
image: [{file: "slinky.e2e.Dockerfile", name: "slinky-simapp"}, {file: "slinky.sidecar.prod.Dockerfile", name: "slinky-sidecar"}, {file: "slinky.local.Dockerfile", name: "slinky-testapp"}, {file: "slinky.sidecar.e2e.Dockerfile", name: "slinky-e2e-sidecar"}]
image: [{file: "connect.e2e.Dockerfile", name: "connect-simapp"}, {file: "slinky.sidecar.prod.Dockerfile", name: "slinky-sidecar"}, {file: "connect.sidecar.prod.Dockerfile", name: "connect-sidecar"}, {file: "connect.local.Dockerfile", name: "connect-testapp"}, {file: "connect.sidecar.e2e.Dockerfile", name: "connect-e2e-sidecar"}]
runs-on: ubuntu-latest-m
permissions:
contents: read
Expand Down Expand Up @@ -109,6 +109,6 @@ jobs:
values_file_name: "values-dev.yaml"
modified_values: |
{
".chain.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['slinky-testapp'] }}",
".sidecar.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['slinky-e2e-sidecar'] }}",
".chain.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['connect-testapp'] }}",
".sidecar.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['connect-e2e-sidecar'] }}",
}
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ export VERSION := $(shell echo $(shell git describe --always --match "v*") | sed
export COMMIT := $(shell git log -1 --format='%H')
export COMETBFT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')

BIN_DIR ?= $(GOPATH)/bin
BIN_DIR ?= $(shell go env GOPATH)/bin
BUILD_DIR ?= $(CURDIR)/build
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
HTTPS_GIT := https://github.com/skip-mev/slinky.git
DOCKER := $(shell which docker)
DOCKER_COMPOSE := $(shell which docker-compose)
HOMEDIR ?= $(CURDIR)/tests/.slinkyd
HOMEDIR ?= $(CURDIR)/tests/.connectd
GENESIS ?= $(HOMEDIR)/config/genesis.json
GENESIS_TMP ?= $(HOMEDIR)/config/genesis_tmp.json
APP_TOML ?= $(HOMEDIR)/config/app.toml
Expand Down Expand Up @@ -54,6 +54,8 @@ BUILD_TAGS := -X github.com/skip-mev/slinky/cmd/build.Build=$(TAG)
build: tidy
go build -ldflags="$(BUILD_TAGS)" \
-o ./build/ ./...
go build -ldflags="$(BUILD_TAGS)" \
-o ./build/connect ./cmd/slinky

run-oracle-client: build
@./build/client --host localhost --port 8080
Expand All @@ -76,6 +78,7 @@ stop-sidecar-dev:

install: tidy
@go install -ldflags="$(BUILD_TAGS)" -mod=readonly ./cmd/slinky
@cp $(BIN_DIR)/slinky $(BIN_DIR)/connect

.PHONY: build install run-oracle-client start-all-dev stop-all-dev

Expand All @@ -85,8 +88,8 @@ install: tidy

docker-build:
@echo "Building E2E Docker image..."
@DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/slinky-e2e -f contrib/images/slinky.e2e.Dockerfile .
@DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/slinky-e2e-oracle -f contrib/images/slinky.sidecar.dev.Dockerfile .
@DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/connect-e2e -f contrib/images/connect.e2e.Dockerfile .
@DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/connect-e2e-oracle -f contrib/images/connect.sidecar.dev.Dockerfile .

.PHONY: docker-build

Expand Down Expand Up @@ -151,13 +154,13 @@ $(BUILD_DIR)/:
@mkdir -p $(BUILD_DIR)/

delete-configs:
@rm -rf ./tests/.slinkyd/
@rm -rf ./tests/.connectd/

build-market-map:
@echo "Building market map..."
@sh ./scripts/genesis.sh

# build-configs builds a slinky simulation application binary in the build folder (/test/.slinkyd)
# build-configs builds a connect simulation application binary in the build folder (/test/.connectd)
build-configs: delete-configs build-market-map
@dasel put -r toml 'instrumentation.enabled' -f $(CONFIG_TOML) -t bool -v true
@dasel put -r toml 'rpc.laddr' -f $(CONFIG_TOML) -t string -v "tcp://0.0.0.0:26657"
Expand All @@ -167,12 +170,12 @@ build-configs: delete-configs build-market-map
@dasel put -r toml 'api.address' -f $(APP_TOML) -t string -v "tcp://0.0.0.0:1317"
@dasel put -r toml 'api.enabled-unsafe-cors' -f $(APP_TOML) -t bool -v true

# start-app starts a slinky simulation application binary in the build folder (/test/.slinkyd)
# start-app starts a connect simulation application binary in the build folder (/test/.connectd)
# this will set the environment variable for running locally
start-app:
@./build/slinkyd start --log_level info --home $(HOMEDIR)
@./build/connectd start --log_level info --home $(HOMEDIR)

# build-and-start-app builds a slinky simulation application binary in the build folder
# build-and-start-app builds a connect simulation application binary in the build folder
# and initializes a single validator configuration. If desired, users can supplement
# other addresses using "genesis add-genesis-account address 10000000000000000000000000stake".
# This will allow users to bootstrap their wallet with a balance.
Expand Down
2 changes: 1 addition & 1 deletion cmd/slinky/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
var (
rootCmd = &cobra.Command{
Use: "oracle",
Short: "Run the slinky oracle server.",
Short: "Run the connect oracle server.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this path to "connect" as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

cmd/connect/main.go

Args: cobra.NoArgs,
RunE: func(_ *cobra.Command, _ []string) error {
return runOracle()
Expand Down
12 changes: 6 additions & 6 deletions contrib/compose/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
market_generator:
build:
context: ../..
dockerfile: ./contrib/images/slinky.generator.dev.Dockerfile
dockerfile: ./contrib/images/connect.generator.dev.Dockerfile
entrypoint: [
"/usr/local/bin/scripts",
"--use-core=$USE_CORE_MARKETS",
Expand Down Expand Up @@ -36,11 +36,11 @@ services:
oracle:
build:
context: ../..
dockerfile: ./contrib/images/slinky.sidecar.dev.Dockerfile
dockerfile: ./contrib/images/connect.sidecar.dev.Dockerfile
environment:
- SLINKY_CONFIG_UPDATEINTERVAL=${SLINKY_CONFIG_UPDATEINTERVAL:-250ms}
entrypoint: [
"slinky",
"connect",
"--market-config-path", "/data/markets.json",
"--pprof-port", "6060",
"--run-pprof",
Expand Down Expand Up @@ -68,7 +68,7 @@ services:
- USE_OSMOSIS_MARKETS=${USE_OSMOSIS_MARKETS:-false}
build:
context: ../..
dockerfile: ./contrib/images/slinky.local.Dockerfile
dockerfile: ./contrib/images/connect.local.Dockerfile
ports:
- "26656:26656"
- "26657:26657"
Expand All @@ -85,9 +85,9 @@ services:
oracle_with_blockchain:
build:
context: ../..
dockerfile: ./contrib/images/slinky.sidecar.dev.Dockerfile
dockerfile: ./contrib/images/connect.sidecar.dev.Dockerfile
entrypoint: [
"slinky",
"connect",
"--update-market-config-path", "/oracle/market.json",
"--market-map-endpoint", "blockchain:9090",
"--pprof-port", "6060",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/skip-mev/slinky-dev-base AS builder
FROM ghcr.io/skip-mev/connect-dev-base AS builder

WORKDIR /src/slinky
WORKDIR /src/connect

COPY go.mod .

Expand All @@ -12,11 +12,11 @@ RUN make build-test-app

## Prepare the final clear binary
## This will expose the tendermint and cosmos ports alongside
## starting up the sim app and the slinky daemon
## starting up the sim app and the connect daemon
FROM ubuntu:rolling
EXPOSE 26656 26657 1317 9090 7171 26655 8081 26660

RUN apt-get update && apt-get install jq -y && apt-get install ca-certificates -y
ENTRYPOINT ["slinkyd", "start"]
ENTRYPOINT ["connectd", "start"]

COPY --from=builder /src/slinky/build/* /usr/local/bin/
COPY --from=builder /src/connect/build/* /usr/local/bin/
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# ./contrib/images/slinky.generator.dev.Dockerfile
# ./contrib/images/connect.generator.dev.Dockerfile

# Stage 1: Build the Go application
FROM golang:1.22 AS builder

WORKDIR /src/slinky
WORKDIR /src/connect

COPY go.mod .

Expand All @@ -15,7 +15,7 @@ RUN make build

# Stage 2: Create a lightweight image for running the application
FROM ubuntu:rolling
COPY --from=builder /src/slinky/build/* /usr/local/bin/
COPY --from=builder /src/connect/build/* /usr/local/bin/

# Create the /data directory
RUN mkdir -p /data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/skip-mev/slinky-dev-base AS builder
FROM ghcr.io/skip-mev/connect-dev-base AS builder

WORKDIR /src/slinky
WORKDIR /src/connect

COPY go.mod .

Expand All @@ -12,7 +12,7 @@ RUN make build-test-app

## Prepare the final clear binary
## This will expose the tendermint and cosmos ports alongside
## starting up the sim app and the slinky daemon
## starting up the sim app and the connect daemon
EXPOSE 26656 26657 1317 9090 7171 26655 8081 26660
RUN apt-get update && apt-get install jq -y && apt-get install ca-certificates -y
ENTRYPOINT ["make", "build-and-start-app"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/skip-mev/slinky-dev-base AS builder
FROM ghcr.io/skip-mev/connect-dev-base AS builder

WORKDIR /src/slinky
WORKDIR /src/connect

COPY go.mod .

Expand All @@ -13,8 +13,8 @@ RUN make build
FROM ubuntu:rolling
EXPOSE 8080 8002

COPY --from=builder /src/slinky/build/* /usr/local/bin/
COPY --from=builder /src/connect/build/* /usr/local/bin/
RUN apt-get update && apt-get install jq -y && apt-get install ca-certificates -y

WORKDIR /usr/local/bin/
ENTRYPOINT [ "slinky" ]
ENTRYPOINT [ "connect" ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/skip-mev/slinky-dev-base AS builder
FROM ghcr.io/skip-mev/connect-dev-base AS builder

WORKDIR /src/slinky
WORKDIR /src/connect

COPY go.mod .

Expand All @@ -13,8 +13,8 @@ RUN make build
FROM ubuntu:rolling
EXPOSE 8080 8002

COPY --from=builder /src/slinky/build/* /usr/local/bin/
COPY --from=builder /src/connect/build/* /usr/local/bin/
RUN apt-get update && apt-get install -y ca-certificates

WORKDIR /usr/local/bin/
ENTRYPOINT [ "slinky" ]
ENTRYPOINT [ "connect" ]
19 changes: 19 additions & 0 deletions contrib/images/connect.sidecar.prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ghcr.io/skip-mev/connect-dev-base AS builder

WORKDIR /src/connect

COPY go.mod .

RUN go mod download

COPY . .

RUN make build

FROM gcr.io/distroless/base-debian11:debug
EXPOSE 8080 8002

COPY --from=builder /src/connect/build/* /usr/local/bin/

WORKDIR /usr/local/bin/
CMD [ "connect" ]
10 changes: 6 additions & 4 deletions contrib/images/slinky.sidecar.prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/skip-mev/slinky-dev-base AS builder
FROM ghcr.io/skip-mev/connect-dev-base AS builder

WORKDIR /src/slinky
WORKDIR /src/connect

COPY go.mod .

Expand All @@ -13,7 +13,9 @@ RUN make build
FROM gcr.io/distroless/base-debian11:debug
EXPOSE 8080 8002

COPY --from=builder /src/slinky/build/* /usr/local/bin/
COPY --from=builder /src/connect/build/* /usr/local/bin/
COPY --from=builder /src/connect/scripts/deprecated-exec.sh /usr/local/bin/

WORKDIR /usr/local/bin/
ENTRYPOINT [ "slinky" ]
ENTRYPOINT [ "deprecated-exec.sh" ]
CMD [ "slinky" ]
17 changes: 17 additions & 0 deletions scripts/deprecated-exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/busybox/sh

echo "
_
| |
___| |_ ___ _ __
/ __| __/ _ \| '_ \
\__ \ || (_) | |_) |
|___/\__\___/| .__/
| |
|_|

WARNING: This container is deprecated and will be removed in future releases.
Please migrate to the corresponding Connect image."

# Execute the binary passed as arguments
exec "$@"
12 changes: 6 additions & 6 deletions tests/integration/slinky_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

var (
image = ibc.DockerImage{
Repository: "skip-mev/slinky-e2e",
Repository: "skip-mev/connect-e2e",
Version: "latest",
UidGid: "1000:1000",
}
Expand All @@ -34,7 +34,7 @@ var (
gasAdjustment = 1.5

oracleImage = ibc.DockerImage{
Repository: "skip-mev/slinky-e2e-oracle",
Repository: "skip-mev/connect-e2e-oracle",
Version: "latest",
UidGid: "1000:1000",
}
Expand Down Expand Up @@ -90,8 +90,8 @@ var (

denom = "stake"
spec = &interchaintest.ChainSpec{
ChainName: "slinky",
Name: "slinky",
ChainName: "connect",
Name: "connect",
NumValidators: &numValidators,
NumFullNodes: &numFullNodes,
Version: "latest",
Expand All @@ -102,10 +102,10 @@ var (
image,
},
Type: "cosmos",
Name: "slinky",
Name: "connect",
Denom: denom,
ChainID: "chain-id-0",
Bin: "slinkyd",
Bin: "connectd",
Bech32Prefix: "cosmos",
CoinType: "118",
GasAdjustment: gasAdjustment,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/slinky_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func DefaultOracleSidecar(image ibc.DockerImage) ibc.SidecarConfig {
HomeDir: "/oracle",
Ports: []string{"8080", "8081"},
StartCmd: []string{
"slinky",
"connect",
"--oracle-config", "/oracle/oracle.json",
},
ValidatorProcess: true,
Expand Down
6 changes: 3 additions & 3 deletions tests/petri/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ func GetChainConfig() types.ChainConfig {
Decimals: 6,
NumValidators: 4,
NumNodes: 2,
BinaryName: "slinkyd",
BinaryName: "connectd",
Image: provider.ImageDefinition{
Image: "skip-mev/slinky-e2e",
Image: "skip-mev/connect-e2e",
UID: "1000",
GID: "1000",
},
SidecarImage: provider.ImageDefinition{
Image: "skip-mev/slinky-e2e-oracle",
Image: "skip-mev/connect-e2e-oracle",
UID: "1000",
GID: "1000",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

"github.com/skip-mev/slinky/tests/simapp"
cmd "github.com/skip-mev/slinky/tests/simapp/slinkyd/testappd"
cmd "github.com/skip-mev/slinky/tests/simapp/connectd/testappd"
)

func main() {
Expand Down
Loading