Fixing swarm BASE_URL propagation during deployment to ensure apps are downloaded properly
This commit is contained in:
@@ -1442,12 +1442,13 @@ class AppBase:
|
|||||||
failed = False
|
failed = False
|
||||||
break
|
break
|
||||||
|
|
||||||
elif ret.status_code == 500 or ret.status_code == 400:
|
#elif ret.status_code == 500 or ret.status_code == 400:
|
||||||
|
elif ret.status_code >= 400:
|
||||||
self.logger.info("[ERROR] (fails: %d) Error in app with status code %d for results (1). RETRYING because results can't be handled" % (i+1, ret.status_code))
|
self.logger.info("[ERROR] (fails: %d) Error in app with status code %d for results (1). RETRYING because results can't be handled" % (i+1, ret.status_code))
|
||||||
|
|
||||||
rettext = ret.text
|
rettext = ret.text
|
||||||
failed = True
|
failed = True
|
||||||
time.sleep(10)
|
time.sleep(8)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ var runningEnvironment = "onprem"
|
|||||||
|
|
||||||
var syncUrl = "https://shuffler.io"
|
var syncUrl = "https://shuffler.io"
|
||||||
|
|
||||||
//var syncUrl = "http://localhost:5002"
|
// var syncUrl = "http://localhost:5002"
|
||||||
var syncSubUrl = "https://shuffler.io"
|
var syncSubUrl = "https://shuffler.io"
|
||||||
|
|
||||||
//var syncUrl = "http://localhost:5002"
|
//var syncUrl = "http://localhost:5002"
|
||||||
@@ -1052,6 +1052,7 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
|
|||||||
chatDisabled = true
|
chatDisabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userOrgs = shuffle.SortOrgList(userOrgs)
|
||||||
orgPriorities := org.Priorities
|
orgPriorities := org.Priorities
|
||||||
if len(org.Priorities) < 5 {
|
if len(org.Priorities) < 5 {
|
||||||
log.Printf("[WARNING] Should find and add priorities as length is less than 5 for org %s", userInfo.ActiveOrg.Id)
|
log.Printf("[WARNING] Should find and add priorities as length is less than 5 for org %s", userInfo.ActiveOrg.Id)
|
||||||
@@ -3916,7 +3917,7 @@ func runInitCloudSetup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runInitEs(ctx context.Context) {
|
func runInitEs(ctx context.Context) {
|
||||||
log.Printf("[DEBUG] Starting INIT setup (ES)")
|
log.Printf("[DEBUG] Starting INIT setup for Elasticsearch/Opensearch")
|
||||||
|
|
||||||
httpProxy := os.Getenv("HTTP_PROXY")
|
httpProxy := os.Getenv("HTTP_PROXY")
|
||||||
if len(httpProxy) > 0 {
|
if len(httpProxy) > 0 {
|
||||||
@@ -3933,7 +3934,7 @@ func runInitEs(ctx context.Context) {
|
|||||||
log.Printf("[DEBUG] Setting default environment for org to %s", defaultEnv)
|
log.Printf("[DEBUG] Setting default environment for org to %s", defaultEnv)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] Getting organizations")
|
log.Printf("[DEBUG] Getting organizations for Elasticsearch/Opensearch")
|
||||||
activeOrgs, err := shuffle.GetAllOrgs(ctx)
|
activeOrgs, err := shuffle.GetAllOrgs(ctx)
|
||||||
|
|
||||||
setUsers := false
|
setUsers := false
|
||||||
@@ -4388,7 +4389,7 @@ func runInit(ctx context.Context) {
|
|||||||
//}
|
//}
|
||||||
//log.Printf("[DEBUG] Finalized init statistics update")
|
//log.Printf("[DEBUG] Finalized init statistics update")
|
||||||
|
|
||||||
log.Printf("[DEBUG] Starting INIT setup")
|
log.Printf("[DEBUG] Starting INIT setup (NOT Opensearch/Elasticsearch!)")
|
||||||
httpProxy := os.Getenv("HTTP_PROXY")
|
httpProxy := os.Getenv("HTTP_PROXY")
|
||||||
if len(httpProxy) > 0 {
|
if len(httpProxy) > 0 {
|
||||||
log.Printf("Running with HTTP proxy %s (env: HTTP_PROXY)", httpProxy)
|
log.Printf("Running with HTTP proxy %s (env: HTTP_PROXY)", httpProxy)
|
||||||
|
|||||||
@@ -446,6 +446,11 @@ func deployServiceWorkers(image string) {
|
|||||||
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("SHUFFLE_WORKER_SERVER_URL=%s", os.Getenv("SHUFFLE_WORKER_SERVER_URL")))
|
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("SHUFFLE_WORKER_SERVER_URL=%s", os.Getenv("SHUFFLE_WORKER_SERVER_URL")))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handles backend
|
||||||
|
if len(os.Getenv("BASE_URL")) > 0 {
|
||||||
|
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("BASE_URL=%s", os.Getenv("BASE_URL")))
|
||||||
|
}
|
||||||
|
|
||||||
if len(os.Getenv("DOCKER_HOST")) > 0 {
|
if len(os.Getenv("DOCKER_HOST")) > 0 {
|
||||||
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("DOCKER_HOST=%s", os.Getenv("DOCKER_HOST")))
|
serviceSpec.TaskTemplate.ContainerSpec.Env = append(serviceSpec.TaskTemplate.ContainerSpec.Env, fmt.Sprintf("DOCKER_HOST=%s", os.Getenv("DOCKER_HOST")))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user