Made SDK have more included libraries, and made App Builder MUCH faster
This commit is contained in:
@@ -2,24 +2,27 @@
|
|||||||
FROM frikky/shuffle:app_sdk as base
|
FROM frikky/shuffle:app_sdk as base
|
||||||
|
|
||||||
# We're going to stage away all of the bloat from the build tools so lets create a builder stage
|
# We're going to stage away all of the bloat from the build tools so lets create a builder stage
|
||||||
FROM base as builder
|
#FROM base as builder
|
||||||
|
|
||||||
# Install all alpine build tools needed for our pip installs
|
# Install all alpine build tools needed for our pip installs
|
||||||
RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev
|
#RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev
|
||||||
|
|
||||||
# Install all of our pip packages in a single directory that we can copy to our base image later
|
# Install all of our pip packages in a single directory that we can copy to our base image later
|
||||||
RUN mkdir /install
|
#RUN mkdir /install
|
||||||
WORKDIR /install
|
#WORKDIR /install
|
||||||
COPY requirements.txt /requirements.txt
|
#COPY requirements.txt /requirements.txt
|
||||||
RUN pip install --prefix="/install" -r /requirements.txt
|
#
|
||||||
|
## Switch back to our base image and copy in all of our built packages and source code
|
||||||
|
#FROM base
|
||||||
|
#COPY --from=builder /install /usr/local
|
||||||
|
|
||||||
# Switch back to our base image and copy in all of our built packages and source code
|
|
||||||
FROM base
|
|
||||||
COPY --from=builder /install /usr/local
|
|
||||||
COPY src /app
|
|
||||||
|
|
||||||
# Install any binary dependencies needed in our final image - this can be a lot of different stuff
|
# Install any binary dependencies needed in our final image - this can be a lot of different stuff
|
||||||
RUN apk --no-cache add --update libmagic
|
#RUN apk --no-cache add --update libmagic
|
||||||
|
WORKDIR /
|
||||||
|
COPY requirements.txt /requirements.txt
|
||||||
|
RUN pip install --prefix="/usr/local" -r /requirements.txt
|
||||||
|
COPY src /app
|
||||||
|
|
||||||
# Finally, lets run our app!
|
# Finally, lets run our app!
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ WORKDIR /install
|
|||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache tzdata
|
#--no-cache
|
||||||
|
RUN apk update && apk add --update tzdata libmagic alpine-sdk libffi libffi-dev musl-dev openssl-dev
|
||||||
|
|
||||||
COPY --from=builder /install /usr/local
|
COPY --from=builder /install /usr/local
|
||||||
COPY requirements.txt /requirements.txt
|
COPY requirements.txt /requirements.txt
|
||||||
RUN pip3 install -r /requirements.txt
|
RUN pip3 install -r /requirements.txt
|
||||||
|
|||||||
@@ -2113,9 +2113,12 @@ class AppBase:
|
|||||||
print("Deleting %s because key = value" % key)
|
print("Deleting %s because key = value" % key)
|
||||||
deletekeys.append(key)
|
deletekeys.append(key)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for deletekey in deletekeys:
|
for deletekey in deletekeys:
|
||||||
del newvalue[deletekey]
|
try:
|
||||||
|
del newvalue[deletekey]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
#print("Post delete: %s" % newvalue)
|
#print("Post delete: %s" % newvalue)
|
||||||
for key, value in newvalue.items():
|
for key, value in newvalue.items():
|
||||||
@@ -2128,8 +2131,16 @@ class AppBase:
|
|||||||
except json.decoder.JSONDecodeError as e:
|
except json.decoder.JSONDecodeError as e:
|
||||||
print("Inner overwrite issue: %s" % e)
|
print("Inner overwrite issue: %s" % e)
|
||||||
continue
|
continue
|
||||||
|
except:
|
||||||
|
print("General error in newvalue items loop")
|
||||||
|
continue
|
||||||
|
|
||||||
action["parameters"][counter]["value"] = json.dumps(newvalue)
|
try:
|
||||||
|
action["parameters"][counter]["value"] = json.dumps(newvalue)
|
||||||
|
except json.decoder.JSONDecodeError as e:
|
||||||
|
print("[WARNING] JsonDecodeError: %s" % e)
|
||||||
|
action["parameters"][counter]["value"] = newvalue
|
||||||
|
|
||||||
|
|
||||||
except json.decoder.JSONDecodeError as e:
|
except json.decoder.JSONDecodeError as e:
|
||||||
print("Failed JSON replacement for OpenAPI keys (2) {e}")
|
print("Failed JSON replacement for OpenAPI keys (2) {e}")
|
||||||
@@ -2137,6 +2148,7 @@ class AppBase:
|
|||||||
break
|
break
|
||||||
|
|
||||||
#print(action["parameters"])
|
#print(action["parameters"])
|
||||||
|
print("Pre parameters")
|
||||||
for parameter in newparams:
|
for parameter in newparams:
|
||||||
action["parameters"].append(parameter)
|
action["parameters"].append(parameter)
|
||||||
|
|
||||||
@@ -2150,6 +2162,7 @@ class AppBase:
|
|||||||
|
|
||||||
# Multi_parameter has the data for each. variable
|
# Multi_parameter has the data for each. variable
|
||||||
minlength = 0
|
minlength = 0
|
||||||
|
print("Pre-loading parameters")
|
||||||
multi_parameters = json.loads(json.dumps(params))
|
multi_parameters = json.loads(json.dumps(params))
|
||||||
multiexecution = False
|
multiexecution = False
|
||||||
multi_execution_lists = []
|
multi_execution_lists = []
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module shuffle
|
|||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||||
|
|
||||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
NAME=shuffle-worker
|
NAME=shuffle-worker
|
||||||
VERSION=0.9.14
|
VERSION=0.9.15
|
||||||
|
|
||||||
echo "Running docker build with $NAME:$VERSION"
|
echo "Running docker build with $NAME:$VERSION"
|
||||||
#CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
|
#CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o worker.bin .
|
||||||
|
|||||||
Reference in New Issue
Block a user