more uv migrations
This commit is contained in:
parent
9d9b810480
commit
a8ddfaddf0
@ -23,13 +23,12 @@ $STD apt-get install -y \
|
|||||||
libc6 \
|
libc6 \
|
||||||
make \
|
make \
|
||||||
cmake \
|
cmake \
|
||||||
jq \
|
jq
|
||||||
python3 \
|
|
||||||
python3-bcrypt
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
NODE_VERSION="22" NODE_MODULE="turbo@1.9.3" install_node_and_modules
|
NODE_VERSION="22" NODE_MODULE="turbo@1.9.3" install_node_and_modules
|
||||||
PG_VERSION="16" install_postgresql
|
PG_VERSION="16" install_postgresql
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
|
||||||
msg_info "Setting up PostgreSQL"
|
msg_info "Setting up PostgreSQL"
|
||||||
DB_NAME="documenso_db"
|
DB_NAME="documenso_db"
|
||||||
@ -55,6 +54,9 @@ curl -fsSL "https://github.com/documenso/documenso/archive/refs/tags/v${RELEASE}
|
|||||||
$STD unzip v${RELEASE}.zip
|
$STD unzip v${RELEASE}.zip
|
||||||
mv documenso-${RELEASE} /opt/documenso
|
mv documenso-${RELEASE} /opt/documenso
|
||||||
cd /opt/documenso
|
cd /opt/documenso
|
||||||
|
$STD uv venv /opt/documenso/.venv
|
||||||
|
source /opt/documenso/.venv/bin/activate
|
||||||
|
$STD /opt/documenso/.venv/bin/uv pip install bcrypt
|
||||||
mv .env.example /opt/documenso/.env
|
mv .env.example /opt/documenso/.env
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \
|
-e "s|^NEXTAUTH_SECRET=.*|NEXTAUTH_SECRET='$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-32)'|" \
|
||||||
@ -78,7 +80,7 @@ echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
|
|||||||
msg_ok "Installed Documenso"
|
msg_ok "Installed Documenso"
|
||||||
|
|
||||||
msg_info "Create User"
|
msg_info "Create User"
|
||||||
PASSWORD_HASH=$(python3 -c "import bcrypt; print(bcrypt.hashpw(b'helper-scripts', bcrypt.gensalt(rounds=12)).decode())")
|
PASSWORD_HASH=$(/opt/documenso/.venv/bin/python3 -c "import bcrypt; print(bcrypt.hashpw(b'helper-scripts', bcrypt.gensalt(rounds=12)).decode())")
|
||||||
$STD sudo -u postgres psql -d documenso_db -c "INSERT INTO \"User\" (name, email, \"emailVerified\", password, \"identityProvider\", roles, \"createdAt\", \"lastSignedIn\", \"updatedAt\", \"customerId\") VALUES ('helper-scripts', 'helper-scripts@local.com', '2025-01-20 17:14:45.058', '$PASSWORD_HASH', 'DOCUMENSO', ARRAY['USER', 'ADMIN']::\"Role\"[], '2025-01-20 16:04:05.543', '2025-01-20 16:14:55.249', '2025-01-20 16:14:55.25', NULL) RETURNING id;"
|
$STD sudo -u postgres psql -d documenso_db -c "INSERT INTO \"User\" (name, email, \"emailVerified\", password, \"identityProvider\", roles, \"createdAt\", \"lastSignedIn\", \"updatedAt\", \"customerId\") VALUES ('helper-scripts', 'helper-scripts@local.com', '2025-01-20 17:14:45.058', '$PASSWORD_HASH', 'DOCUMENSO', ARRAY['USER', 'ADMIN']::\"Role\"[], '2025-01-20 16:04:05.543', '2025-01-20 16:14:55.249', '2025-01-20 16:14:55.25', NULL) RETURNING id;"
|
||||||
$STD npm run prisma:migrate-deploy
|
$STD npm run prisma:migrate-deploy
|
||||||
msg_ok "User created"
|
msg_ok "User created"
|
||||||
|
@ -17,34 +17,31 @@ msg_info "Installing Dependencies"
|
|||||||
$STD apt-get install -y git
|
$STD apt-get install -y git
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setup Python3"
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
$STD apt-get install -y \
|
|
||||||
python3 \
|
|
||||||
python3-dev \
|
|
||||||
python3-pip \
|
|
||||||
python3-venv
|
|
||||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
|
||||||
msg_ok "Setup Python3"
|
|
||||||
|
|
||||||
msg_info "Installing ESPHome"
|
msg_info "Setting up Virtual Environment"
|
||||||
mkdir /root/config
|
mkdir -p /opt/esphome
|
||||||
$STD pip install esphome tornado esptool
|
$STD uv venv /opt/esphome/.venv
|
||||||
msg_ok "Installed ESPHome"
|
source /opt/esphome/.venv/bin/activate
|
||||||
|
$STD /opt/esphome/.venv/bin/uv pip install esphome tornado esptool
|
||||||
|
msg_ok "Setup and Installed ESPHome"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
|
mkdir -p /root/config
|
||||||
cat <<EOF >/etc/systemd/system/esphomeDashboard.service
|
cat <<EOF >/etc/systemd/system/esphomeDashboard.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ESPHome Dashboard
|
Description=ESPHome Dashboard
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/esphome dashboard /root/config/
|
ExecStart=/opt/esphome/.venv/bin/esphome dashboard /root/config/
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
systemctl enable -q --now esphomeDashboard
|
systemctl enable -q --now esphomeDashboard
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
@ -14,12 +14,10 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y make ca-certificates
|
||||||
make \
|
|
||||||
ca-certificates \
|
|
||||||
python3.11-venv
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules
|
NODE_VERSION="22" NODE_MODULE="yarn@latest" install_node_and_modules
|
||||||
|
|
||||||
msg_info "Installing Grist"
|
msg_info "Installing Grist"
|
||||||
@ -28,20 +26,22 @@ export CYPRESS_INSTALL_BINARY=0
|
|||||||
export NODE_OPTIONS="--max-old-space-size=2048"
|
export NODE_OPTIONS="--max-old-space-size=2048"
|
||||||
cd /opt
|
cd /opt
|
||||||
curl -fsSL "https://github.com/gristlabs/grist-core/archive/refs/tags/v${RELEASE}.zip" -o "v${RELEASE}.zip"
|
curl -fsSL "https://github.com/gristlabs/grist-core/archive/refs/tags/v${RELEASE}.zip" -o "v${RELEASE}.zip"
|
||||||
$STD unzip v$RELEASE.zip
|
$STD unzip "v${RELEASE}.zip"
|
||||||
mv grist-core-${RELEASE} grist
|
mv "grist-core-${RELEASE}" /opt/grist
|
||||||
cd grist
|
cd /opt/grist
|
||||||
|
$STD uv venv /opt/grist/sandbox_venv3
|
||||||
|
$STD /opt/grist/sandbox_venv3/bin/uv pip install -r sandbox/requirements.txt
|
||||||
$STD yarn install
|
$STD yarn install
|
||||||
$STD yarn run build:prod
|
$STD yarn run build:prod
|
||||||
$STD yarn run install:python
|
ln -sf /opt/grist/sandbox_venv3/bin/python3 /opt/grist/sandbox_venv3/bin/python
|
||||||
cat <<EOF >/opt/grist/.env
|
cat <<EOF >/opt/grist/.env
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
GRIST_HOST=0.0.0.0
|
GRIST_HOST=0.0.0.0
|
||||||
EOF
|
EOF
|
||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
echo "${RELEASE}" >/opt/grist_version.txt
|
||||||
msg_ok "Installed Grist"
|
msg_ok "Installed Grist"
|
||||||
|
|
||||||
msg_info "Create Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/grist.service
|
cat <<EOF >/etc/systemd/system/grist.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Grist
|
Description=Grist
|
||||||
@ -52,6 +52,7 @@ Type=exec
|
|||||||
WorkingDirectory=/opt/grist
|
WorkingDirectory=/opt/grist
|
||||||
ExecStart=/usr/bin/yarn run start:prod
|
ExecStart=/usr/bin/yarn run start:prod
|
||||||
EnvironmentFile=-/opt/grist/.env
|
EnvironmentFile=-/opt/grist/.env
|
||||||
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@ -64,7 +65,7 @@ motd_ssh
|
|||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -rf /opt/v${RELEASE}.zip
|
rm -rf "/opt/v${RELEASE}.zip"
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
@ -13,19 +13,6 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Setup Python3"
|
|
||||||
$STD apt-get install -y \
|
|
||||||
python3 \
|
|
||||||
python3-dev \
|
|
||||||
python3-pip \
|
|
||||||
python3-venv
|
|
||||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
|
||||||
msg_ok "Setup Python3"
|
|
||||||
|
|
||||||
msg_info "Installing runlike"
|
|
||||||
$STD pip install runlike
|
|
||||||
msg_ok "Installed runlike"
|
|
||||||
|
|
||||||
get_latest_release() {
|
get_latest_release() {
|
||||||
curl -fsSL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
curl -fsSL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
||||||
}
|
}
|
||||||
@ -36,8 +23,8 @@ PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
|
|||||||
|
|
||||||
msg_info "Installing Docker $DOCKER_LATEST_VERSION"
|
msg_info "Installing Docker $DOCKER_LATEST_VERSION"
|
||||||
DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
|
DOCKER_CONFIG_PATH='/etc/docker/daemon.json'
|
||||||
mkdir -p $(dirname $DOCKER_CONFIG_PATH)
|
mkdir -p $(dirname "$DOCKER_CONFIG_PATH")
|
||||||
echo -e '{\n "log-driver": "journald"\n}' >/etc/docker/daemon.json
|
echo -e '{\n "log-driver": "journald"\n}' >"$DOCKER_CONFIG_PATH"
|
||||||
$STD sh <(curl -fsSL https://get.docker.com)
|
$STD sh <(curl -fsSL https://get.docker.com)
|
||||||
msg_ok "Installed Docker $DOCKER_LATEST_VERSION"
|
msg_ok "Installed Docker $DOCKER_LATEST_VERSION"
|
||||||
|
|
||||||
|
@ -13,12 +13,11 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
$STD apt-get install -y pip
|
|
||||||
msg_ok "Installed Dependencies"
|
|
||||||
|
|
||||||
msg_info "Installing Homer"
|
msg_info "Installing Homer"
|
||||||
mkdir -p /opt/homer
|
mkdir -p /opt/homer
|
||||||
|
$STD uv venv /opt/homer/.venv
|
||||||
cd /opt/homer
|
cd /opt/homer
|
||||||
curl -fsSL "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip" -o "homer.zip"
|
curl -fsSL "https://github.com/bastienwirtz/homer/releases/latest/download/homer.zip" -o "homer.zip"
|
||||||
$STD unzip homer.zip
|
$STD unzip homer.zip
|
||||||
@ -34,7 +33,7 @@ After=network-online.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/opt/homer
|
WorkingDirectory=/opt/homer
|
||||||
ExecStart=python3 -m http.server 8010
|
ExecStart=/opt/homer/.venv/bin/python3 -m http.server 8010
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
@ -13,6 +13,8 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
|
||||||
msg_info "Configuring apt and installing dependencies"
|
msg_info "Configuring apt and installing dependencies"
|
||||||
echo "deb http://deb.debian.org/debian testing main contrib" >/etc/apt/sources.list.d/immich.list
|
echo "deb http://deb.debian.org/debian testing main contrib" >/etc/apt/sources.list.d/immich.list
|
||||||
cat <<EOF >/etc/apt/preferences.d/immich
|
cat <<EOF >/etc/apt/preferences.d/immich
|
||||||
@ -27,8 +29,6 @@ $STD apt-get install --no-install-recommends -y \
|
|||||||
redis \
|
redis \
|
||||||
autoconf \
|
autoconf \
|
||||||
build-essential \
|
build-essential \
|
||||||
python3-venv \
|
|
||||||
python3-dev \
|
|
||||||
cmake \
|
cmake \
|
||||||
jq \
|
jq \
|
||||||
libbrotli-dev \
|
libbrotli-dev \
|
||||||
@ -304,25 +304,25 @@ cp LICENSE "$APP_DIR"
|
|||||||
msg_ok "Installed Immich Web Components"
|
msg_ok "Installed Immich Web Components"
|
||||||
|
|
||||||
cd "$SRC_DIR"/machine-learning
|
cd "$SRC_DIR"/machine-learning
|
||||||
$STD python3 -m venv "$ML_DIR/ml-venv"
|
$STD uv venv "$ML_DIR/.venv"
|
||||||
|
$ML_DIR/.venv/bin/uv pip install --upgrade uv
|
||||||
|
$ML_DIR/.venv/bin/uv sync --no-cache
|
||||||
|
cd "$SRC_DIR"/machine-learning
|
||||||
|
$STD uv venv "$ML_DIR/.venv"
|
||||||
|
$ML_DIR/.venv/bin/uv pip install --upgrade uv
|
||||||
|
|
||||||
if [[ -f ~/.openvino ]]; then
|
if [[ -f ~/.openvino ]]; then
|
||||||
msg_info "Installing HW-accelerated machine-learning"
|
msg_info "Installing HW-accelerated machine-learning"
|
||||||
(
|
$STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra openvino
|
||||||
source "$ML_DIR"/ml-venv/bin/activate
|
patchelf --clear-execstack "$ML_DIR/.venv/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-312-x86_64-linux-gnu.so"
|
||||||
$STD pip3 install uv
|
|
||||||
uv -q sync --extra openvino --no-cache --active
|
|
||||||
)
|
|
||||||
patchelf --clear-execstack "$ML_DIR"/ml-venv/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_pybind11_state.cpython-311-x86_64-linux-gnu.so
|
|
||||||
msg_ok "Installed HW-accelerated machine-learning"
|
msg_ok "Installed HW-accelerated machine-learning"
|
||||||
|
|
||||||
else
|
else
|
||||||
msg_info "Installing machine-learning"
|
msg_info "Installing machine-learning"
|
||||||
(
|
$STD "$ML_DIR/.venv/bin/uv" sync --no-cache --extra cpu
|
||||||
source "$ML_DIR"/ml-venv/bin/activate
|
|
||||||
$STD pip3 install uv
|
|
||||||
uv -q sync --extra cpu --no-cache --active
|
|
||||||
)
|
|
||||||
msg_ok "Installed machine-learning"
|
msg_ok "Installed machine-learning"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$SRC_DIR"
|
cd "$SRC_DIR"
|
||||||
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
cp -a machine-learning/{ann,immich_ml} "$ML_DIR"
|
||||||
if [[ -f ~/.openvino ]]; then
|
if [[ -f ~/.openvino ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user