Skip to content

Commit 2ad0808

Browse files
committed
final adjustments
Signed-off-by: bigcat88 <[email protected]>
1 parent 3f73d89 commit 2ad0808

File tree

6 files changed

+100
-48
lines changed

6 files changed

+100
-48
lines changed

CHANGELOG.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,39 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.1.0 - 2024-12-18]
6+
7+
The [Visionatrix](https://github.com/Visionatrix/Visionatrix) service has been updated from version `1.4.1` to `1.9.0`.
8+
The main changes are summarized below:
9+
10+
### Added
11+
12+
- Support for flows that produce `video` files as output.
13+
- `OpenAPI` specs support, enabling easier development of Nextcloud Apps that can seamlessly use Visionatrix flows.
14+
- Many new `flows` with updated models.
15+
- Parallel installation of `flows` and `models`.
16+
17+
### Changed
18+
19+
- Online `flows` and `models` storage has been separated, ensuring the integration remains stable.
20+
- Added support for both `Ollama` and `Gemini` as providers for `Vision` and `Prompt translation`.
21+
22+
### Fixed
23+
24+
- Numerous bug fixes and significant performance improvements.
25+
526
## [1.0.1 - 2024-10-18]
627

728
### Changed
829

9-
- Bumped bundled Visionatrix from `1.3.0` to `1.4.1` version, changelog can be found [here](https://github.com/Visionatrix/Visionatrix/releases/tag/v1.4.0)
30+
- Updated the bundled Visionatrix from version `1.3.0` to `1.4.1`. The changelog for this update can be found [here](https://github.com/Visionatrix/Visionatrix/releases/tag/v1.4.0).
1031

1132
### Fixed
1233

13-
- Warning "sudo: unable to resolve host" during container startup.
34+
- Resolved the warning "sudo: unable to resolve host" during container startup.
1435

1536
## [1.0.0 - 2024-09-25]
1637

1738
### Added
1839

19-
- First release with bundled Visionatrix version `1.3.0`
40+
- Initial release with the bundled Visionatrix version `1.3.0`.

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ ENV VIX_SERVER_FULL_MODELS="1"
1313
RUN apt-get update && apt-get install -y git \
1414
python3-dev python3-setuptools netcat-traditional \
1515
libxml2-dev libxslt1-dev zlib1g-dev g++ \
16-
ffmpeg libsm6 libxext6 lsb-release sudo wget procps nano xmlstarlet
16+
ffmpeg libsm6 libxext6 lsb-release sudo wget procps nano xmlstarlet && \
17+
apt-get autoclean
18+
19+
ADD ex_app_scripts/common_pgsql.sh /ex_app_scripts/
20+
RUN chmod +x /ex_app_scripts/common_pgsql.sh
21+
22+
ADD ex_app_scripts/install_pgsql.sh /ex_app_scripts/
23+
RUN chmod +x /ex_app_scripts/install_pgsql.sh && /ex_app_scripts/install_pgsql.sh && rm /ex_app_scripts/install_pgsql.sh
1724

1825
COPY appinfo/info.xml /info.xml
1926

@@ -42,8 +49,12 @@ RUN cd /Visionatrix && \
4249
RUN cd /Visionatrix && \
4350
venv/bin/python -m pip install "psycopg[binary]" greenlet && \
4451
venv/bin/python -m pip install . && \
45-
AUTO_INIT_CONFIG_MODELS_DIR=$MODELS_DIR venv/bin/python scipts/easy_install.py && \
52+
rm -rf ~/.cache/pip
53+
54+
RUN cd /Visionatrix && \
4655
venv/bin/python -m visionatrix install && \
56+
AUTO_INIT_CONFIG_MODELS_DIR=$MODELS_DIR venv/bin/python scripts/easy_install.py && \
57+
rm visionatrix.db && \
4758
rm -rf ~/.cache/pip
4859

4960
# Setup nodejs and npm for building the front-end client

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ This is a standalone [Visionatrix](https://github.com/Visionatrix/Visionatrix) s
1616

1717
Each user is authenticated via Nextcloud credentials and has a personal task history.
1818

19+
> [!NOTE]
20+
> We recommend starting with the "light-weight" flows, such as SDXL Lighting, Remove background (BiRefNet), and Remove background (Bria), to test your hardware.
21+
1922
## TextToImage Provider
2023

2124
You can use Visionatrix as the TextToImage provider via [Nextcloud Assistant](https://github.com/nextcloud/assistant).

ex_app_scripts/common_pgsql.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# Common environment variables
4+
PG_VERSION=16
5+
PG_BIN="/usr/lib/postgresql/${PG_VERSION}/bin"
6+
PG_SQL="/usr/lib/postgresql/${PG_VERSION}/bin/psql"
7+
BASE_DIR="${APP_PERSISTENT_STORAGE:-/nc_app_${APP_ID:-visionatrix}_data}"
8+
DATA_DIR="${BASE_DIR}/pgsql"
9+
10+
# Function to ensure PostgreSQL is installed
11+
ensure_postgres_installed() {
12+
# Check if PostgreSQL is installed by checking for the existence of binary files
13+
if [ -d "$PG_BIN" ]; then
14+
echo "PostgreSQL binaries found."
15+
else
16+
echo "PostgreSQL binaries not found."
17+
echo "Adding the PostgreSQL APT repository..."
18+
apt-get update && apt-get install -y gnupg
19+
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
20+
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
21+
echo "Installing PostgreSQL..."
22+
apt-get update && apt-get install -y postgresql-$PG_VERSION
23+
fi
24+
}
25+
26+
# Function to initialize the database (if needed) and start PostgreSQL
27+
init_and_start_postgres() {
28+
# Ensure the directory exists and has the correct permissions
29+
mkdir -p "$DATA_DIR"
30+
chown -R postgres:postgres "$DATA_DIR"
31+
32+
if [ ! -d "$DATA_DIR/base" ]; then
33+
echo "Initializing the PostgreSQL database..."
34+
sudo -u postgres ${PG_BIN}/initdb -D "$DATA_DIR"
35+
PG_CONF="${DATA_DIR}/postgresql.conf"
36+
if ! grep -q "^listen_addresses\s*=\s*''" "$PG_CONF"; then
37+
echo "Updating PostgreSQL configuration to disable TCP/IP connections..."
38+
echo "listen_addresses = ''" >> "$PG_CONF"
39+
fi
40+
fi
41+
42+
echo "Starting PostgreSQL..."
43+
sudo -u postgres ${PG_BIN}/pg_ctl -D "$DATA_DIR" -l "${DATA_DIR}/logfile" start
44+
45+
echo "Waiting for PostgreSQL to start..."
46+
until sudo -u postgres ${PG_SQL} -c "SELECT 1" > /dev/null 2>&1; do
47+
sleep 1
48+
echo -n "."
49+
done
50+
echo "PostgreSQL is up and running."
51+
}

ex_app_scripts/init_pgsql.sh

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
DB_NAME=${APP_ID:-visionatrix}
55
DB_USER=${APP_ID:-visionatrix}
66
DB_PASS=${APP_ID:-visionatrix}
7-
BASE_DIR="${APP_PERSISTENT_STORAGE:-/nc_app_visionatrix_data}"
87

98
# Check if EXTERNAL_DATABASE is set
109
if [ -n "${EXTERNAL_DATABASE}" ]; then
@@ -21,49 +20,10 @@ if [ -n "${EXTERNAL_DATABASE}" ]; then
2120
exit 0
2221
fi
2322

24-
# PostgreSQL version to use
25-
PG_VERSION=15
26-
PG_BIN="/usr/lib/postgresql/${PG_VERSION}/bin"
27-
PG_SQL="/usr/lib/postgresql/${PG_VERSION}/bin/psql"
23+
source /ex_app_scripts/common_pgsql.sh
2824

29-
# Define the PostgreSQL data directory
30-
DATA_DIR="${BASE_DIR}/pgsql"
31-
32-
# Check if PostgreSQL is installed by checking for the existence of binary files
33-
if [ -d "$PG_BIN" ]; then
34-
echo "PostgreSQL binaries found."
35-
else
36-
echo "PostgreSQL binaries not found."
37-
echo "Adding the PostgreSQL APT repository..."
38-
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
39-
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
40-
echo "Installing PostgreSQL..."
41-
apt-get update && apt-get install -y postgresql-$PG_VERSION
42-
fi
43-
44-
# Ensure the directory exists and has the correct permissions
45-
mkdir -p "$DATA_DIR"
46-
chown -R postgres:postgres "$DATA_DIR"
47-
48-
if [ ! -d "$DATA_DIR/base" ]; then
49-
echo "Initializing the PostgreSQL database..."
50-
sudo -u postgres ${PG_BIN}/initdb -D "$DATA_DIR"
51-
PG_CONF="${DATA_DIR}/postgresql.conf"
52-
if ! grep -q "^listen_addresses\s*=\s*''" "$PG_CONF"; then
53-
echo "Updating PostgreSQL configuration to disable TCP/IP connections..."
54-
echo "listen_addresses = ''" >> "$PG_CONF"
55-
fi
56-
fi
57-
58-
echo "Starting PostgreSQL..."
59-
sudo -u postgres ${PG_BIN}/pg_ctl -D "$DATA_DIR" -l "${DATA_DIR}/logfile" start
60-
61-
echo "Waiting for PostgreSQL to start..."
62-
until sudo -u postgres ${PG_SQL} -c "SELECT 1" > /dev/null 2>&1; do
63-
sleep 1
64-
echo -n "."
65-
done
66-
echo "PostgreSQL is up and running."
25+
ensure_postgres_installed
26+
init_and_start_postgres
6727

6828
# Check if the user exists and create if not
6929
sudo -u postgres $PG_SQL -c "SELECT 1 FROM pg_user WHERE usename = '$DB_USER'" | grep -q 1 || \

ex_app_scripts/install_pgsql.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
source /ex_app_scripts/common_pgsql.sh
4+
5+
ensure_postgres_installed
6+
init_and_start_postgres

0 commit comments

Comments
 (0)