forked from cerc-io/stack-orchestrator
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
def192edab | ||
|
|
d8357df345 | ||
|
|
997496b8a5 | ||
|
|
61f2884505 | ||
|
|
27a14737f8 |
@@ -12,6 +12,7 @@ services:
|
||||
command: ["./build-app-for-urbit.sh"]
|
||||
volumes:
|
||||
- ../config/osmosis/build-app-for-urbit.sh:/app/packages/web/build-app-for-urbit.sh
|
||||
- ../config/osmosis/.env.production:/app/packages/web/.env.production
|
||||
- urbit_app_builds:/app-builds
|
||||
- ../config/osmosis/urbit-files/mar:/app/packages/web/mar
|
||||
- ../config/osmosis/urbit-files/desk.docket-0:/app/packages/web/desk.docket-0
|
||||
|
||||
@@ -10,6 +10,7 @@ services:
|
||||
command: ["./build-app.sh"]
|
||||
volumes:
|
||||
- ../config/osmosis/build-app.sh:/app/packages/web/build-app.sh
|
||||
- ../config/osmosis/.env.production:/app/packages/web/.env.production
|
||||
- app_builds:/app-builds
|
||||
|
||||
nginx:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
NEXT_PUBLIC_COINGECKO_URL=https://api.coingecko.com
|
||||
|
||||
NEXT_PUBLIC_ENABLE_FEATURES=true
|
||||
@@ -12,7 +12,7 @@ if [ -d /app-builds/osmosis/build ]; then
|
||||
fi
|
||||
|
||||
yarn build:static
|
||||
./build.sh
|
||||
./build-urbit.sh
|
||||
|
||||
# Move build to app-builds
|
||||
mkdir -p /app-builds/osmosis
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
|
||||
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
||||
ARG VARIANT=20-bullseye
|
||||
ARG VARIANT=20-bullseye-slim
|
||||
FROM node:${VARIANT}
|
||||
|
||||
ARG USERNAME=node
|
||||
@@ -30,7 +30,7 @@ RUN \
|
||||
|
||||
# [Optional] Uncomment this section to install additional OS packages.
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install --no-install-recommends jq gettext-base moreutils
|
||||
&& apt-get -y install --no-install-recommends jq gettext-base
|
||||
|
||||
# [Optional] Uncomment if you want to install more global node modules
|
||||
# RUN su node -c "npm install -g <your-package-list-here>"
|
||||
|
||||
@@ -104,7 +104,8 @@ CUR_NEXT_VERSION="`jq -r '.dependencies.next' package.json`"
|
||||
|
||||
if [ "$CERC_NEXT_VERSION" != "keep" ] && [ "$CUR_NEXT_VERSION" != "$CERC_NEXT_VERSION" ]; then
|
||||
echo "Changing 'next' version specifier from '$CUR_NEXT_VERSION' to '$CERC_NEXT_VERSION' (set with '--extra-build-args \"--build-arg CERC_NEXT_VERSION=$CERC_NEXT_VERSION\"')"
|
||||
cat package.json | jq ".dependencies.next = \"$CERC_NEXT_VERSION\"" | sponge package.json
|
||||
cat package.json | jq ".dependencies.next = \"$CERC_NEXT_VERSION\"" > package.json.$$
|
||||
mv package.json.$$ package.json
|
||||
fi
|
||||
|
||||
$CERC_BUILD_TOOL install || exit 1
|
||||
@@ -128,7 +129,8 @@ to use for the build with:
|
||||
###############################################################################
|
||||
|
||||
EOF
|
||||
cat package.json | jq ".dependencies.next = \"^$CERC_MIN_NEXTVER\"" | sponge package.json
|
||||
cat package.json | jq ".dependencies.next = \"^$CERC_MIN_NEXTVER\"" > package.json.$$
|
||||
mv package.json.$$ package.json
|
||||
$CERC_BUILD_TOOL install || exit 1
|
||||
fi
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ if [ "$CERC_NEXTJS_SKIP_GENERATE" != "true" ]; then
|
||||
while [ $count -lt $CERC_MAX_GENERATE_TIME ] && [ "$generate_done" == "false" ]; do
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
grep 'rendered as static HTML' gen.out > /dev/null
|
||||
grep 'rendered as static' gen.out > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
generate_done="true"
|
||||
fi
|
||||
|
||||
@@ -200,9 +200,10 @@ class ClusterInfo:
|
||||
)
|
||||
containers.append(container)
|
||||
volumes = volumes_for_pod_files(self.parsed_pod_yaml_map)
|
||||
image_pull_secrets = [client.V1LocalObjectReference(name="laconic-registry")]
|
||||
template = client.V1PodTemplateSpec(
|
||||
metadata=client.V1ObjectMeta(labels={"app": self.app_name}),
|
||||
spec=client.V1PodSpec(containers=containers, volumes=volumes),
|
||||
spec=client.V1PodSpec(containers=containers, image_pull_secrets=image_pull_secrets, volumes=volumes),
|
||||
)
|
||||
spec = client.V1DeploymentSpec(
|
||||
replicas=1, template=template, selector={
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright ©2023 Vulcanize
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
@@ -13,6 +12,7 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import shlex
|
||||
@@ -51,7 +51,6 @@ def process_app_deployment_request(
|
||||
raise Exception("Only unqualified hostnames allowed at this time.")
|
||||
|
||||
fqdn = f"{requested_name}.{dns_suffix}"
|
||||
container_tag = "%s:local" % app.attributes.name.replace("@", "")
|
||||
|
||||
# 3. check ownership of existing dnsrecord vs this request
|
||||
# TODO: Support foreign DNS
|
||||
@@ -94,13 +93,14 @@ def process_app_deployment_request(
|
||||
deployment_record = laconic.get_record(app_deployment_crn)
|
||||
deployment_dir = os.path.join(deployment_parent_dir, fqdn)
|
||||
deployment_config_file = os.path.join(deployment_dir, "config.env")
|
||||
deployment_container_tag = "laconic-webapp/%s:local" % hashlib.md5(deployment_dir.encode()).hexdigest()
|
||||
# b. check for deployment directory (create if necessary)
|
||||
if not os.path.exists(deployment_dir):
|
||||
if deployment_record:
|
||||
raise ("Deployment record %s exists, but not deployment dir %s. Please remove name." %
|
||||
(app_deployment_crn, deployment_dir))
|
||||
raise Exception("Deployment record %s exists, but not deployment dir %s. Please remove name." %
|
||||
(app_deployment_crn, deployment_dir))
|
||||
print("deploy_webapp", deployment_dir)
|
||||
deploy_webapp.create_deployment(ctx, deployment_dir, container_tag,
|
||||
deploy_webapp.create_deployment(ctx, deployment_dir, deployment_container_tag,
|
||||
f"https://{fqdn}", kube_config, image_registry, env_filename)
|
||||
elif env_filename:
|
||||
shutil.copyfile(env_filename, deployment_config_file)
|
||||
@@ -108,7 +108,7 @@ def process_app_deployment_request(
|
||||
needs_k8s_deploy = False
|
||||
# 6. build container (if needed)
|
||||
if not deployment_record or deployment_record.attributes.application != app.id:
|
||||
build_container_image(app, container_tag)
|
||||
build_container_image(app, deployment_container_tag)
|
||||
push_container_image(deployment_dir)
|
||||
needs_k8s_deploy = True
|
||||
|
||||
@@ -262,7 +262,7 @@ def command(ctx, kube_config, laconic_config, image_registry, deployment_parent_
|
||||
record_namespace_deployments,
|
||||
record_namespace_dns,
|
||||
dns_suffix,
|
||||
deployment_parent_dir,
|
||||
os.path.abspath(deployment_parent_dir),
|
||||
kube_config,
|
||||
image_registry
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user