Skip to content

Commit

Permalink
fix(build): use classic linker on macos sonoma
Browse files Browse the repository at this point in the history
rename NODE_ to AKASHD_

Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Aug 9, 2023
1 parent 1aba479 commit 4c48733
Show file tree
Hide file tree
Showing 19 changed files with 428 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Go mod tidy
run: go mod tidy
- name: Make node scripts executable
run: make chmod-node-scripts
run: make chmod-akash-scripts
- name: Prepare images
run: make -s -C _run/kube kube-prepare-images
- uses: engineerd/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ builds:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
archives:
- format: binary
- format: binary
dockers:
- dockerfile: Dockerfile
use: buildx
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM debian:bullseye
LABEL "org.opencontainers.image.source"="https://github.com/akash-network/provider"

COPY provider-services /bin/
COPY provider-services /usr/bin/

RUN \
apt-get update \
Expand Down
19 changes: 14 additions & 5 deletions _run/common-kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ KUBE_DOCKER_IMAGE_ARCH ?= $(shell uname -m | sed "s/x86_64/amd64/g")

AKASH_LOCAL_DOCKER_IMAGE ?= ghcr.io/akash-network/node:latest-$(KUBE_DOCKER_IMAGE_ARCH)

ifeq ($(AKASH_SRC_IS_LOCAL), true)
ifeq ($(AKASHD_BUILD_FROM_SRC), true)
AKASH_DOCKER_IMAGE ?= $(AKASH_LOCAL_DOCKER_IMAGE)
AKASH_BUILD_LOCAL_IMAGE := true
else
AKASH_BUILD_LOCAL_IMAGE := false
AKASH_DOCKER_IMAGE ?= ghcr.io/akash-network/node:$(AKASH_VERSION)-$(KUBE_DOCKER_IMAGE_ARCH)
AKASH_DOCKER_IMAGE ?= ghcr.io/akash-network/node:$(AKASHD_VERSION)-$(KUBE_DOCKER_IMAGE_ARCH)
AKASH_DOCKER_IMAGE_EXISTS := $(shell docker inspect --type=image $(AKASH_DOCKER_IMAGE) >/dev/null 2>&1 && echo true || echo false)
ifeq ($(shell $(AKASH_DOCKER_IMAGE_EXISTS)), false)
AKASH_DOCKER_IMAGE := $(AKASH_LOCAL_DOCKER_IMAGE)
Expand All @@ -34,7 +34,7 @@ else
undefine AKASH_DOCKER_IMAGE_EXISTS
endif

DOCKER_IMAGE ?= ghcr.io/akash-network/provider:latest-$(KUBE_DOCKER_IMAGE_ARCH)
DOCKER_IMAGE ?= $(RELEASE_DOCKER_IMAGE):latest-$(KUBE_DOCKER_IMAGE_ARCH)

PROVIDER_HOSTNAME ?= localhost
PROVIDER_HOST = $(PROVIDER_HOSTNAME):$(KIND_HTTP_PORT)
Expand All @@ -50,11 +50,20 @@ DOCKER_LOAD_IMAGES += $(AKASH_DOCKER_IMAGE)
endif

.PHONY: kube-prepare-images
kube-prepare-images:
kube-prepare-images: kube-prepare-image-provider-services kube-prepare-image-akash

.PHONY: kube-prepare-image-provider-services
kube-prepare-image-provider-services:
ifneq ($(SKIP_BUILD), true)
make -C $(AP_ROOT) docker-image
endif

.PHONY: kube-prepare-image-akash
kube-prepare-image-akash: RELEASE_DOCKER_IMAGE=ghcr.io/akash-network/node
kube-prepare-image-akash:
ifneq ($(SKIP_BUILD), true)
ifeq ($(AKASH_BUILD_LOCAL_IMAGE), true)
make -C $(AKASH_LOCAL_PATH) docker-image
make -C $(AKASHD_LOCAL_PATH) docker-image
else
docker pull $(AKASH_DOCKER_IMAGE)
endif
Expand Down
13 changes: 7 additions & 6 deletions _run/common-kustomize.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ KUSTOMIZE_OPERATOR_IP := $(KUSTOMIZE_DIR)/akash-operator-ip

CLIENT_EXPORT_PASSWORD ?= 12345678

SETUP_KUBE := $(ROOT_DIR)/script/setup-kube.sh

$(KUSTOMIZE_DIR):
mkdir -p $(KUSTOMIZE_DIR)

Expand All @@ -22,23 +24,22 @@ kustomize-templates: $(patsubst %, kustomize-template-%,$(KUSTOMIZE_INSTALLS))
kustomize-template-%:
cp -r $(ROOT_DIR)/_docs/kustomize/templates/$* $(KUSTOMIZE_DIR)/


#### Kustomize configure images
.PHONY: kustomize-set-images
kustomize-set-images: $(patsubst %, kustomize-set-image-%,$(KUSTOMIZE_INSTALLS))

.PHONY: kustomize-set-image-akash-node
kustomize-set-image-akash-node:
echo "- op: replace\n path: /spec/template/spec/containers/0/image\n value: $(AKASH_DOCKER_IMAGE)" > $(KUSTOMIZE_DIR)/akash-node/docker-image.yaml
$(SETUP_KUBE) kustomize image "containers/0" "$(AKASH_DOCKER_IMAGE)" > "$(KUSTOMIZE_DIR)/akash-node/docker-image.yaml"

.PHONY: kustomize-set-image-akash-provider
kustomize-set-image-akash-provider:
echo "- op: replace\n path: /spec/template/spec/initContainers/0/image\n value: $(AKASH_DOCKER_IMAGE)" > $(KUSTOMIZE_DIR)/akash-provider/docker-image.yaml
echo "- op: replace\n path: /spec/template/spec/containers/0/image\n value: $(DOCKER_IMAGE)" >> $(KUSTOMIZE_DIR)/akash-provider/docker-image.yaml
$(SETUP_KUBE) kustomize image "initContainers/0" "$(AKASH_DOCKER_IMAGE)" > "$(KUSTOMIZE_DIR)/akash-provider/docker-image.yaml"
$(SETUP_KUBE) kustomize image "containers/0" "$(DOCKER_IMAGE)" >> "$(KUSTOMIZE_DIR)/akash-provider/docker-image.yaml"

.PHONY: kustomize-set-image-akash-operator-%
kustomize-set-image-akash-operator-%:
echo "- op: replace\n path: /spec/template/spec/containers/0/image\n value: $(DOCKER_IMAGE)" > "$(KUSTOMIZE_DIR)/akash-operator-$*/docker-image.yaml"
$(SETUP_KUBE) kustomize image "containers/0" "$(DOCKER_IMAGE)" > "$(KUSTOMIZE_DIR)/akash-operator-$*/docker-image.yaml"

#### Kustomize configurations
.PHONY: kustomize-configure-services
Expand All @@ -65,7 +66,7 @@ kustomize-configure-akash-operator-hostname:

.PHONY: kustomize-configure-akash-operator-ip
kustomize-configure-akash-operator-ip: akash-init
echo "provider-address=$(PROVIDER_ADDRESS)\n" > "$(KUSTOMIZE_DIR)/akash-operator-ip/configmap.yaml"
echo -e "provider-address=$(PROVIDER_ADDRESS)" > "$(KUSTOMIZE_DIR)/akash-operator-ip/configmap.yaml"

.PHONY: kustomize-configure-akash-operator-inventory
kustomize-configure-configure-operator-inventory:
Expand Down
2 changes: 1 addition & 1 deletion _run/kube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ hostname-operator:
clean-kube:

.PHONY: kube-deployments-rollout
kube-deployments-rollout:
kube-deployments-rollout: #$(patsubst %, kube-deployment-rollout-%,$(KUSTOMIZE_INSTALLS))

.PHONY: kube-setup-kube
kube-setup-kube:
2 changes: 1 addition & 1 deletion cluster/kube/builder/workload.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (b *Workload) container() corev1.Container {
case GPUVendorAMD:
resourceName = ResourceGPUAMD
default:
panic(fmt.Sprintf("requested for unsupported GPU vendor"))
panic("requested for unsupported GPU vendor")
}

// GPUs are only supposed to be specified in the limits section, which means
Expand Down
3 changes: 1 addition & 2 deletions cmd/provider-services/cmd/sdl-to-manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"encoding/json"
"errors"
"fmt"

"github.com/spf13/cobra"
Expand All @@ -24,7 +23,7 @@ func SDL2ManifestCmd() *cobra.Command {
case outputJSON:
case outputYAML:
default:
return errors.New(fmt.Sprintf("invalid output format \"%s\", expected json|yaml", format)) // nolint: goerr113, revive
return fmt.Errorf("invalid output format \"%s\", expected json|yaml", format) // nolint: goerr113
}

return nil
Expand Down
48 changes: 25 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/akash-network/provider
go 1.18

require (
github.com/akash-network/akash-api v0.0.25
github.com/akash-network/node v0.23.2-rc2
github.com/akash-network/akash-api v0.0.26
github.com/akash-network/node v0.23.2-rc7
github.com/avast/retry-go/v4 v4.5.0
github.com/boz/go-lifecycle v0.1.1
github.com/cosmos/cosmos-sdk v0.45.16
Expand All @@ -23,13 +23,13 @@ require (
github.com/prometheus/common v0.44.0
github.com/rook/rook v1.11.1
github.com/shopspring/decimal v1.3.1
github.com/spf13/cobra v1.6.1
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.2
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/tendermint/tendermint v0.34.27
go.uber.org/zap v1.24.0
golang.org/x/sync v0.2.0
golang.org/x/sync v0.3.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
Expand Down Expand Up @@ -98,7 +98,7 @@ require (
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/cosmos/ibc-go/v4 v4.4.1 // indirect
github.com/cosmos/ibc-go/v4 v4.4.2 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
Expand Down Expand Up @@ -166,7 +166,7 @@ require (
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/improbable-eng/grpc-web v0.14.1 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmhodges/levigo v1.0.1-0.20191019112844-b572e7f4cdac // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down Expand Up @@ -200,7 +200,7 @@ require (
github.com/oklog/run v1.1.0 // indirect
github.com/openshift/api v0.0.0-20210105115604-44119421ec6b // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand All @@ -212,12 +212,12 @@ require (
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/rs/zerolog v1.27.0 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
Expand All @@ -230,24 +230,26 @@ require (
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.step.sm/crypto v0.26.0 // indirect
go.step.sm/crypto v0.34.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20221019170559-20944726eadf // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230720185612-659f7aaaa771 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
Expand Down
Loading

0 comments on commit 4c48733

Please sign in to comment.