Skip to content

Commit

Permalink
local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
joremysh committed Oct 12, 2024
1 parent ac3020e commit ffd3184
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ SOCAT_PORT=2375
# container build
DOCKER_BUILDKIT=1
COMPOSE_DOCKER_CLI_BUILD=1

API_GATEWAY_PROTOCOL=http
API_GATEWAY_URL=api-gateway:8080
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,22 @@ unit-test: ## Run unit test

.PHONY: integration-test
integration-test: ## Run integration test
@TEST_FOLDER_ABS_PATH=${PWD} k6 run \
TEST_FOLDER_ABS_PATH=${PWD} k6 run \
-e API_GATEWAY_PROTOCOL=${API_GATEWAY_PROTOCOL} -e API_GATEWAY_URL=${API_GATEWAY_URL} integration-test/grpc.js --no-usage-report --quiet
@TEST_FOLDER_ABS_PATH=${PWD} k6 run \
TEST_FOLDER_ABS_PATH=${PWD} k6 run \
-e API_GATEWAY_PROTOCOL=${API_GATEWAY_PROTOCOL} -e API_GATEWAY_URL=${API_GATEWAY_URL} integration-test/rest.js --no-usage-report --quiet
@TEST_FOLDER_ABS_PATH=${PWD} k6 run \
TEST_FOLDER_ABS_PATH=${PWD} k6 run \
-e API_GATEWAY_PROTOCOL=${API_GATEWAY_PROTOCOL} -e API_GATEWAY_URL=${API_GATEWAY_URL} integration-test/rest_with_jwt.js --no-usage-report --quiet

.PHONY: help
help: ## Show this help
@echo "\nMakefile for local development"
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m (default: help)\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-18s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

start:
go run ./cmd/migration/main.go
go run ./cmd/init/main.go
# go run ./cmd/worker/main.go

start-main:
go run ./cmd/main/main.go
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func ValidateConfig(_ *AppConfig) error {
return nil
}

var defaultConfigPath = "config/config.yaml"
var defaultConfigPath = "config/config.local.yaml"

// ParseConfigFlag allows clients to specify the relative path to the file from
// which the configuration will be loaded.
Expand Down
92 changes: 92 additions & 0 deletions config/config.local.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
server:
privateport: 3083
publicport: 8083
https:
cert:
key:
edition: local-ce:dev
usage:
usageidentifieruid:
enabled: true
tlsenabled: true
host: usage.instill.tech
port: 443
debug: true
maxdatasize: 100 # MB in unit
workflow:
maxworkflowtimeout: 3600 # in seconds
maxworkflowretry: 1
maxactivityretry: 3
instillcorehost: http://localhost:8080
taskschemaversion: 8f4ee7a
database:
username: postgres
password: password
host: localhost
port: 5432
name: model
version: 11
timezone: Etc/UTC
pool:
idleconnections: 5
maxconnections: 30
connlifetime: 30m # In minutes, e.g., '60m'
rayserver:
grpcuri: localhost:9000
modelstore: ./model-config
vram:
mgmtbackend:
host: localhost
publicport: 8084
privateport: 3084
https:
cert:
key:
artifactbackend:
host: localhost
publicport: 8082
privateport: 3082
https:
cert:
key:
cache:
redis:
redisoptions:
addr: localhost:6379
maxbatchsizelimitation:
unspecified: 2
classification: 16
detection: 8
keypoint: 8
ocr: 2
instancesegmentation: 8
semanticsegmentation: 8
textgeneration: 1
temporal:
hostport: localhost:7233
namespace: model-backend
retention: 1d
ca:
cert:
key:
servername:
initmodel:
enabled: false
path: https://raw.githubusercontent.com/instill-ai/instill-core/main/model-hub/model_hub_test.json
log:
external: false
otelcollector:
host: otel-collector
port: 8095
openfga:
host: localhost
port: 8060
registry:
host: registry
port: 5000
minio:
host: localhost
port: 19000
rootuser: minioadmin
rootpwd: minioadmin
bucketname: instill-ai-model
2 changes: 1 addition & 1 deletion pkg/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func (r *repository) DeleteModelVersionByDigest(ctx context.Context, modelUID uu
func (r *repository) GetLatestModelVersionByModelUID(ctx context.Context, modelUID uuid.UUID) (version *datamodel.ModelVersion, err error) {
db := r.CheckPinnedUser(ctx, r.db, "model_version")

queryBuilder := db.Model(&datamodel.ModelVersion{}).Where("(model_uid = ?)", modelUID)
queryBuilder := db.Where("(model_uid = ?)", modelUID)

if result := queryBuilder.Order("update_time DESC").First(&version); result.Error != nil {
return nil, result.Error
Expand Down

0 comments on commit ffd3184

Please sign in to comment.