2025년 12월 14일 일요일

Installation for Qwen3-vl:4b on Windows 11

Windows 11에서 Ollama를 설치하고 Qwen3-VL 4B 모델을 돌려본 과정을 정리해 둔다. 텍스트뿐 아니라 이미지도 같이 넣을 수 있는 모델이다. 아래 캡처는 설치할 때 실제로 나온 화면들이다.

먼저 알아둘 것

  • OS는 Windows 10 22H2 이상이면 된다.
  • NVIDIA 그래픽카드를 쓴다면 드라이버가 551.61 이상이어야 한다. GPU가 없어도 CPU로 돌아가긴 하는데 느릴 수 있다.
  • Ollama 설치에 4GB 정도, qwen3-vl:4b 모델 파일이 3.3GB라서 여유 공간을 넉넉히 잡아두는 게 좋다.
  • Qwen3-VL은 Ollama 0.12.7 이상에서 동작한다. 최신 버전을 받으면 문제 없다.

설치 순서 (아래 캡처 순서와 같다)

  1. https://ollama.com 에서 Windows용 OllamaSetup.exe를 받아 실행하고 Install을 누른다. 관리자 권한은 필요 없고 사용자 계정 폴더에 설치된다.
  2. 파일 압축을 푸는 진행 화면이 나오는데 끝날 때까지 기다린다.
  3. 중간에 Microsoft Visual C++ 2015-2022 Redistributable(x64) 설치 창이 뜨면 그대로 진행한다.
  4. 설치가 끝나면 Ollama 앱이 뜬다. 채팅창 오른쪽 아래 모델 선택에서 qwen3-vl:4b를 고르고 아무 메시지나 보내면, 처음 한 번 모델을 내려받은 뒤 대화할 수 있다.

 

https://ollama.com/





















터미널에서 실행하기

PowerShell이나 cmd에서 아래 명령으로도 같은 모델을 쓸 수 있다.

ollama run qwen3-vl:4b

이미지를 넣을 때는 질문 뒤에 이미지 파일 경로를 같이 적어주면 된다.

모델 크기

Ollama 라이브러리 기준으로 2b는 1.9GB, 4b는 3.3GB, 8b는 6.2GB, 30b는 20GB 정도이고 컨텍스트는 전부 256K다. 메모리가 넉넉하지 않으면 2b나 4b가 무난하다.

참고

  • Ollama 서버는 http://localhost:11434 에서 동작해서 API로도 호출할 수 있다.
  • 모델 파일은 기본적으로 %HOMEPATH%\.ollama 에 저장된다. 위치를 바꾸려면 사용자 환경변수 OLLAMA_MODELS를 지정하면 된다.
  • 로그는 %LOCALAPPDATA%\Ollama 폴더의 app.log, server.log에서 볼 수 있다.

용량과 최소 버전은 2026년 10월 기준 Ollama 공식 페이지 내용이라 이후에 바뀔 수 있다.

2023년 3월 13일 월요일

[Docker] docker build RUN apk update Error

Step 3/7 : RUN apk update

 ---> Running in 2fdba320b542

fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz

fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz

ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.9/main: temporary error (try again later)

WARNING: Ignoring APKINDEX.b89edf6e.tar.gz: No such file or directory

ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.9/community: temporary error (try again later)

WARNING: Ignoring APKINDEX.737f7e01.tar.gz: No such file or directory



$ docker build --tag shlee/springboot-cicd:latest --no-cache --network=host .

 --> Add "--network=host" .. 


[업데이트 2026-10]

  • 컨테이너 안에서 apk 인덱스를 받아오지 못해서 나는 오류다. 빌드하는 동안 컨테이너 네트워크(DNS 포함)가 막혀 있을 때 자주 나고, --network=host를 주면 호스트 네트워크를 그대로 써서 해결되는 경우가 많다.
  • 예제의 Alpine v3.9는 오래된 버전이라 저장소 주소가 더 이상 응답하지 않을 수 있다. 베이스 이미지를 최신 Alpine 태그로 올려서 다시 빌드해 보는 것도 방법이다.

2023년 3월 10일 금요일

Nexus Installation on Ubuntu

$ mkdir nexus

$ wget https://download.sonatype.com/nexus/3/nexus-3.39.0-01-unix.tar.gz

$ sudo apt-get update

$ sudo apt install openjdk-8-jdk-headless

$ cd nexus/bin


- install & startup : nexus run

- startup : nexus start

- stop : nexus stop



[업데이트 2026-10]

  • 위의 3.39.0 + JDK 8 조합은 오래된 구성이다. 최신 버전은 Sonatype 다운로드 페이지에서 확인하고, 필요한 Java 버전은 받은 버전의 요구사항을 따른다. 최근 배포본에는 JDK가 같이 들어 있는 경우가 있어서 따로 설치하지 않아도 될 수 있다.
  • root가 아닌 별도 사용자(예: nexus)로 실행하는 것이 좋다.
  • 기동하면 기본 접속 주소는 http://localhost:8081 이다.
  • 초기 admin 비밀번호는 sonatype-work/nexus3/admin.password 파일에 들어 있다. 처음 로그인한 뒤 바꿔준다.

SonarQube Installation ( on Ubuntu )

 $ sudo apt update




$ sudo apt -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common


$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -






$ wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.8.0.63668.zip


$ unzip sonarqube-9.8.0.63668.zip


$ sudo groupadd sonar


$ sudo useradd -c "SonarQube - User" -d /home/shlee/sonarqube/ -g sonar sonar


# $ sudo chown -R sonar:sonar /home/shlee/sonarqube/


$ sudo chown -R shlee:shlee /home/shlee/sonarqube/




$ /home/shlee/sonarqube/bin/linux-x86-64/sonar.sh start


$ /home/shlee/sonarqube/bin/linux-x86-64/sonar.sh stop




$ curl localhost:9000 [admin/admin and change password]




[SonarQube Setup in gitlab / SonarQube]


1) create gitlab Impersonation Token in Gitlab


2) create gitlab project and insert gitlab Token in sonarqube 


3) create credential for "admin" account in sonarqube 


   and copy credential, paste to jenkins new credentials






[SonarQube Setup In jenkins]


Install GitLab plugin for Jenkins - version 1.5.13 or later


Install SonarQube Scanner plugin for Jenkins - version 2.11 or later




setting for integrating cicd


setting for sonarqube server 




[Jenkinsfile]


  withSonarQubeEnv('sonarqube_rookie01') {


                sh "mvn clean verify sonar:sonar -Dsonar.projectKey=<프로젝트 키>"


              }




sonarqube_rookie01 <- ID for sonarQube Server Setting


<프로젝트 키> <-- project key in sonarqube


-----




(1) Docker Push in Jenkinsfile


 docker.withRegistry('<Docker Registry URL>', '<Credential defined in Jenkins Credentials>') {


     dockerImage.push('<Tag>')


 }




ex>


 docker.withRegistry('http://localhost:7890/repository/docker-local-registry/', 'docker_credential') {


      dockerImage.push('latest')


 }




(2) Integrate Sonar with Jenkins


 withSonarQubeEnv('<Name of Jenkins SonarQube Server Settings>') {


      sh "mvn clean verify <Goal for SonarQube (default :  'sonar:sonar' )> -Dsonar.projectKey=<ProjectKey generated by SonarQube Server>"


 }


[업데이트 2026-10]

  • SonarQube 9.8은 오래된 버전이다. 현재 Community Build는 Java 17 또는 21이 필요하고, 압축을 푸는 디렉터리 이름이 숫자로 시작하면 안 된다.
  • 첫 로그인은 admin/admin이고, 로그인하면 바로 비밀번호를 바꿔준다.
  • 맨 위의 Docker apt 키 등록 명령은 SonarQube 설치와 직접 관련이 없어 보인다. 복사하다 섞인 것 같으니 따라 하지 않아도 된다.
  • 스캐너(SonarScanner)의 Java 요구 버전도 올라가고 있다. 2026년 7월부터 Community Build용 스캐너는 Java 21만 지원하고, JRE 자동 프로비저닝이 켜져 있으면 따로 신경 쓰지 않아도 된다.
  • 프로젝트 키는 노출을 피하려고 <프로젝트 키>로 바꿔 두었다.

Prometheus & Grafana Installation (on Ubuntu)

 [Prometheus]


1) download prometheus

$ wget <https://prometheus.io/download/ 에서 OS에 맞는 파일의 주소>

압축 해제.. & prometheus.yml 편집

scrape_configs:

  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.

  - job_name: "prometheus"


    # metrics_path defaults to '/metrics'

    # scheme defaults to 'http'.

    static_configs:

      - targets: ["localhost:9091"]

      - 

  - job_name: "springboot"

    scrape_interval: 15s

    metrics_path: "/actuator/prometheus"

    static_configs:

      - targets: ["rookie01.local:8080"]

      - 

2) startup

$ ./prometheus --config.file=prometheus.yml  --web.listen-address="0.0.0.0:9091" --web.enable-lifecycle 2>&1 | tee -a ./startup.log &



3) shutdown

$ curl -X POST localhost:9091/-/quit   ( or kill )


4) brower 접속

http://localhost:9091

http://localhost:9091/metrics



[Grafana]

1) download installation file

$ wget https://dl.grafana.com/enterprise/release/grafana-enterprise-9.3.6.linux-amd64.tar.gz


2) startup

$ ./bin/grafana-server web


3) browser 접속

http://localhost:3000  ( admin / admin ; 첫 로그인 후 비밀번호 변경)


4) springboot 용 pannel 샘플 다운로드 / Import

 download from : https://grafana.com/grafana/dashboards/12900-springboot-apm-dashboard/


[업데이트 2026-10]

  • Prometheus 다운로드 명령이 Alpine 저장소 주소로 잘못 들어가 있었다(복사 실수). Prometheus 공식 다운로드 페이지(https://prometheus.io/download/)에서 OS에 맞는 파일을 받는 것으로 고쳤다.
  • Grafana 9.3.6도 오래된 버전이라 새로 설치한다면 Grafana 공식 다운로드 페이지에서 최신 버전을 확인한다.
  • Grafana 기본 계정은 admin/admin이고, 첫 로그인 후 비밀번호를 바꾸면 된다. 글에 적혀 있던 비밀번호 힌트는 지웠다.

2020년 3월 27일 금요일

Push Docker Image to GCR from WSL

[업데이트 2026-10]

Container Registry(gcr.io)는 종료되어 2025년 3월 18일부터 이미지 쓰기가 막혔다. 아래 gcr.io 푸시 방식은 그대로는 쓸 수 없고, Artifact Registry를 쓰거나 gcr.io 주소를 Artifact Registry로 마이그레이션해야 한다. 서울 리전 기준으로는 이렇게 한다.

$ gcloud auth configure-docker asia-northeast3-docker.pkg.dev
$ gcloud artifacts repositories create REPO --repository-format=docker --location=asia-northeast3
$ docker tag config-server asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO/config-server:latest
$ docker push asia-northeast3-docker.pkg.dev/PROJECT_ID/REPO/config-server:latest

이메일, 프로젝트 ID, 로그인 URL, PC 이름은 노출을 피하려고 가렸다. 아래는 2020년 당시 기록이다.


user@pc:~$ docker images
REPOSITORY                                       TAG                 IMAGE ID            CREATED             SIZE
asia.gcr.io/PROJECT_ID/config-server   latest              f9559cb4a95e        25 hours ago        135MB
test/configserver                                latest              f9559cb4a95e        25 hours ago        135MB
openjdk                                          8-jdk-alpine        a3562aa0b991        10 months ago       105MB
hello-world                                      latest              fce289e99eb9        15 months ago       1.84kB

user@pc:~$ docker push asia.gcr.io/PROJECT_ID/config-server
WARNING: Could not open the configuration file: [/home/user/.config/gcloud/configurations/config_default].
ERROR: (gcloud.auth.docker-helper) You do not currently have an active account selected.
Please run:

  $ gcloud auth login

to obtain new credentials, or if you have already logged in with a
different account:

  $ gcloud config set account ACCOUNT

to select an already authenticated account to use.
The push refers to repository [asia.gcr.io/PROJECT_ID/config-server]
9bb9d4296990: Preparing
ceaf9e1ebef5: Preparing
9b9b7f3d56a0: Preparing
f1b5933fe4b5: Preparing
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
user@pc:~$ gcloud auth login
Go to the following link in your browser:

    (로그인 URL 생략)


Enter verification code: <Hidden>

You are now logged in as [계정 이메일].
Your current project is [None].  You can change this setting by running:
  $ gcloud config set project PROJECT_ID

user@pc:~$ gcloud config set project PROJECT_ID
Updated property [core/project].


user@pc:~$ docker push asia.gcr.io/PROJECT_ID/config-server
The push refers to repository [asia.gcr.io/PROJECT_ID/config-server]
9bb9d4296990: Pushed
ceaf9e1ebef5: Layer already exists
9b9b7f3d56a0: Layer already exists
f1b5933fe4b5: Layer already exists
latest: digest: sha256:5b309a37ba393e74461b10eb52c96b4dc670425b1ba546ffa27f618e607ef6d5 size: 1159




2020년 3월 22일 일요일

Install gcloud on WSL (Ubuntu)

1) Run WSL

2) Add the Cloud SDK distribution URI as a package source
$ echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
3) Install apt-transport-https
$ sudo apt-get install apt-transport-https ca-certificates gnupg

4) Import the Google Cloud Platform public key
$ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg

5) Update the package list and install the Cloud SDK
$ sudo apt-get update && sudo apt-get install google-cloud-cli

6) Install Additional Component
$ sudo apt-get install google-cloud-cli-app-engine-java

7) Start gcloud
$ gcloud init

[업데이트 2026-10]

  • apt-key 방식은 더 이상 권장되지 않아서 공개키 등록을 gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg로, 저장소 주소를 https로 바꿨다.
  • 패키지 이름이 google-cloud-sdk에서 google-cloud-cli로 바뀌어서 5번과 6번 명령도 고쳤다. (App Engine Java 컴포넌트는 google-cloud-cli-app-engine-java)
  • 공식 문서 기준으로는 3번에서 apt-transport-https 없이 ca-certificates gnupg curl만 설치한다.
  • WSL 자체를 새로 설치한다면 wsl --install 한 줄로 끝난다.

2020년 3월 20일 금요일

docker-compose error (Unable to enable NAT rule)

$ docker-compose up -d
Creating network "chapter04_default" with the default driver
ERROR: Failed to Setup IP tables: Unable to enable NAT rule:  (iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.21.0.0/16 ! -o br-8cbf06e4b2c9 -j MASQUERADE: iptables: No chain/target/match by that name.
 (exit status 1))

[Fix]
$ sudo vi /etc/docker/daemon.json
{
    "iptables":false
}

and then..

restart dockerd


[업데이트 2026-10]

  • "iptables": false는 도커가 iptables 규칙(NAT, 포트 공개)을 자동으로 만들지 않게 하는 임시 우회 방법이다. 이 상태에서는 컨테이너의 외부 통신이나 -p 포트 공개가 안 될 수 있다.
  • 이 오류는 WSL1처럼 iptables 관련 커널 모듈이 없는 환경에서 날 수 있다. 가능하면 WSL2를 쓰는 편이 낫고, 우회가 필요 없어졌다면 daemon.json 설정은 되돌려 둔다.

2020년 3월 18일 수요일

docker daemon is not running in WSL Ubuntu

1. Launch WSL with admin priviledge
2. su - root
3. dockerd

[업데이트 2026-10]

  • WSL에서는 sudo service docker start로 도커 데몬을 띄우는 방법도 있다. root로 dockerd를 직접 실행하면 그 터미널을 닫을 때 같이 종료된다.
  • WSL2에서 systemd를 켜 두었다면 부팅할 때 도커가 자동으로 올라오게 설정할 수 있다. 번거로우면 Windows용 Docker Desktop을 쓰는 방법도 있다.

2020년 3월 17일 화요일

Setting or change WSL root password

1. Open PowerShell Console
2. Comand
PS C:\Users\user> wsl -u root
root@pc:/mnt/c/Users/user#
root@pc:/mnt/c/Users/user# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


[업데이트 2026-10]

  • 배포판을 지정해야 하면 wsl -d Ubuntu -u root처럼 쓴다. 설치된 배포판 이름은 wsl -l -v로 확인한다.
  • 일반 사용자의 비밀번호를 바꿀 때는 root로 들어가서 passwd 사용자명을 실행한다.
  • PC 이름과 Windows 계정명은 가려 두었다.