Quick start
You can install Bareun quickly with the command below.
docker pull bareunai/bareun:latest
Running Docker
Pull the Docker image as above, then run it with the command below.
mkdir -p ~/bareun/var
docker run \
-d \
--restart unless-stopped \
--name bareun \
--user $UID:$GID \
-p 5656:5656 \
-v ~/bareun/var:/bareun/var \
bareunai/bareun:latest
The -v ~/bareun/var:/bareun/var mount keeps the registration information, custom dictionary, logs, and also the models downloaded
on first startup on the host. Without this mount, every time you recreate the container you would download several hundred MB of models again,
so be sure to include it.
Running Docker on Windows
These are the steps to install Docker Desktop on Windows 10.
-
Run Command Prompt in administrator mode
- Run Command Prompt with administrator privileges. Running as administrator grants access to system files so you can run the required commands.
-
Install WSL (Windows Subsystem for Linux)
- Install WSL, which provides a Linux environment on Windows.
wsl --install -
Change the WSL version
- Change the default WSL version to 2.
cmd wsl --set-default-version 2
- Change the default WSL version to 2.
-
Enable the Virtual Machine Platform
- These two commands enable the Windows Subsystem for Linux and the Virtual Machine Platform on Windows.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart -
Confirm the features are enabled and reboot Windows
- In this step, confirm that both commands ended with the output 'completed', then reboot Windows.
-
When the Ubuntu setup screen appears, create an ID and password
- This step creates the account information needed the first time you install Ubuntu.
-
Download and run the latest WSL2 Linux kernel update package from the link below
- This step updates WSL2 to the latest version.
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
- This step updates WSL2 to the latest version.
-
Download Docker Desktop for Windows
- Go to the link below to download Docker Desktop.
https://www.docker.com/products/docker-desktop/
- Go to the link below to download Docker Desktop.
-
Run
Docker Desktop Installer.exeto install- This step installs the Docker Desktop you downloaded.
-
Launch the Docker Desktop icon
- This step runs the Docker Desktop you installed.
-
Run Command Prompt in administrator mode
- Run Command Prompt with administrator privileges once more.
-
Install bareun with the Docker command
- This step installs
Bareunthrough Docker by running the command.
docker pull bareunai/bareun:latest - This step installs
-
Run the
BareunDocker containerIn Windows
PowerShell, you can run it with the command below.docker run ` -d ` --restart unless-stopped ` --name bareun ` -p 5656:5656 ` -v ~/bareun/var:/bareun/var ` bareunai/bareun:latest
For the original source of the Windows Docker installation steps for Bareun above, see here.
Registering an API key in Docker
Use the command below to register the API key you received after signing up on the website, entering it after the -reg argument.
docker exec bareun /bareun/bin/bareun -reg YOUR-API-KEY
Understanding the Docker environment
The Bareun var volume
In general, a Docker volume is a way to store information that stays available even after Docker stops running. It mainly lets a Docker container use a specific folder inside the system.
However, processes in a Docker container usually run as the root account. The container can create various files in the folder you connected as a volume. Then the files created at run time are created with root privileges. When you need to delete or clean up those files, this can become very inconvenient. Some organizations with tight security even block access to the superuser on their Linux systems altogether.
Bareun creates various files at run time.
- The custom dictionary is kept in compiled form. Even if you stop
Bareunwhen needed and run it again, it has to work again, so the dictionary must be stored. - It creates usage log files, which help improve
Bareun. - When an error occurs during use, it records and keeps it.
- It stores information related to the API key.
So we built the Bareun Docker image to work without problems whether it runs as the superuser
or with ordinary user privileges. Depending on your system setup, if you use it for research or personal purposes,
we recommend running it in ordinary user mode.
This is exactly why the command line above includes --user $UID:$GID.
It means to run with the privileges of the user who ran the command.
Service port
First, it helps to look at Bareun's service port.
Bareun uses port 5656 by default.
As the diagram below shows, ConnectRPC routes the various requests appropriately.
Users can always send requests comfortably through the same port, and the service stays safe.
graph LR
A1[python lib] --> B[5656];
A2[REST req] --> B[5656];
A3[grpc-web req] --> B[5656];
B --> Connect{ConnectRPC};
Connect -->|http/1.1| GRPC[5656];
Connect -->|grpc| GRPC[5656];
Connect -->|grpc-web| GRPC[5656];
Connect -->|http/1.1| WEB[5656];
GRPC --> SVC1[LangService];
GRPC --> SVC2[CustomDictService];
GRPC --> SVC3[RevisionService];
Managing inside Docker
The bareun process runs inside Docker.
bareun
: Bareun is the main service.
Bareun always runs stably, so the service is not interrupted under any circumstances.
There may be cases where you need to stop it and start it again.
Always ready
Bareun keeps serving without interruption even when external files or the custom dictionary change.
- Even if the license file changes in real time, the service does not need to be restarted.
- Even if the custom dictionary changes, the service keeps running stably.
When a service restart is needed
A restart may be needed in the following cases.
- If you need to change the settings, you must restart the service.
- If the model is updated, you must restart it.
How to restart
Just restart Docker itself. Here is how to restart it.
docker restart bareun
Viewing logs
docker logs -f bareun
With the command above, you can check the logs of the bareun container.
The on-premises Bareun writes logs directly, whereas the Docker version sends logs to standard output.
Sending them to standard output makes it easier to view logs in Kubernetes and similar environments.