From 1560640f8e18fee2c4a8ae89ff789ff6cdab4248 Mon Sep 17 00:00:00 2001 From: randy1568 Date: Mon, 12 May 2025 09:37:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E9=80=82=E9=85=8Ddocker=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E4=B8=8B=E8=BD=BD=E5=9C=B0=E5=9D=80=E4=B8=BA=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E6=89=80=E4=BB=93=E5=BA=93=E9=95=9C=E5=83=8F=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8D/etc/docker=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E5=9C=BA=E6=99=AF=203?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9anythingLLM=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E5=8D=B7=E6=8C=82=E8=BD=BD=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B8=BA777?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/anythingLLM/config.yaml | 4 +++- plugins/anythingLLM/workspace/install.yaml | 10 +++++----- plugins/anythingLLM/workspace/install_docker.yaml | 5 +++++ plugins/anythingLLM/workspace/uninstall.yaml | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/anythingLLM/config.yaml b/plugins/anythingLLM/config.yaml index a265175..c9dd22e 100644 --- a/plugins/anythingLLM/config.yaml +++ b/plugins/anythingLLM/config.yaml @@ -10,10 +10,12 @@ all: docker_download_url: x86_64: https://download.docker.com/linux/static/stable/x86_64/docker-26.1.4.tgz aarch64: https://download.docker.com/linux/static/stable/aarch64/docker-26.1.4.tgz + anythingLLM_image_url: + aarch64: hub.oepkgs.net/oedeploy/mintplexlabs/aarch64/anythingllm + x86_64: hub.oepkgs.net/oedeploy/mintplexlabs/x86_64/anythingllm docker_download_path: /tmp docker_image_urls: https://docker.m.daocloud.io container_name: "anythinglLLM-container" - docker_image: "mintplexlabs/anythingllm" storage_location: "{{ lookup('env', 'HOME') }}/anythingllm" host_port: 3001 \ No newline at end of file diff --git a/plugins/anythingLLM/workspace/install.yaml b/plugins/anythingLLM/workspace/install.yaml index 333dc2a..7b38009 100644 --- a/plugins/anythingLLM/workspace/install.yaml +++ b/plugins/anythingLLM/workspace/install.yaml @@ -63,25 +63,25 @@ when: container_result.rc == 0 - name: check if exists anythingLLM image - shell: docker images | grep {{ docker_image }} + shell: docker images | grep {{ anythingLLM_image_url[ansible_architecture] }} register: image_result ignore_errors: yes - name: pull anythingLLM image - shell: docker pull {{ docker_image }} + shell: docker pull {{ anythingLLM_image_url[ansible_architecture] }} when: image_result.rc != 0 - name: create STORAGE_LOCATION directory file: path: "{{ storage_location }}" state: directory - mode: '0755' + mode: '0777' - name: create .env file file: path: "{{ storage_location }}/.env" state: touch - mode: '0644' + mode: '0777' - name: start anythingLLM container shell: > @@ -92,6 +92,6 @@ -v {{ storage_location }}:/app/server/storage -v {{ storage_location }}/.env:/app/server/.env -e STORAGE_DIR="/app/server/storage" - {{ docker_image }} + {{ anythingLLM_image_url[ansible_architecture] }} register: container_start_result failed_when: container_start_result.rc != 0 \ No newline at end of file diff --git a/plugins/anythingLLM/workspace/install_docker.yaml b/plugins/anythingLLM/workspace/install_docker.yaml index ae29c1d..ca373b2 100644 --- a/plugins/anythingLLM/workspace/install_docker.yaml +++ b/plugins/anythingLLM/workspace/install_docker.yaml @@ -23,6 +23,11 @@ - name: mv docker file to /usr/bin shell: mv {{ docker_download_path }}/docker/* /usr/bin +- name: create directory /etc/docker + shell: > + [ -d /etc/docker ]; + mkdir -p /etc/docker + - name: configur docker image url template: src=daemon.json.j2 dest=/etc/docker/daemon.json diff --git a/plugins/anythingLLM/workspace/uninstall.yaml b/plugins/anythingLLM/workspace/uninstall.yaml index bfc2599..5f07e77 100644 --- a/plugins/anythingLLM/workspace/uninstall.yaml +++ b/plugins/anythingLLM/workspace/uninstall.yaml @@ -11,7 +11,7 @@ ignore_errors: true - name: delete docker image - shell: docker rmi {{ docker_image }} + shell: docker rmi {{ anythingLLM_image_url[ansible_architecture] }} ignore_errors: true - name: check if docker_already_deploy file exists -- Gitee From 43a89c0fd54f670792833892f6fccb6e78da28e9 Mon Sep 17 00:00:00 2001 From: randy1568 Date: Wed, 14 May 2025 11:48:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=9C=B0=E5=9D=80=E4=B8=BA=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E6=89=80=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/anythingLLM/config.yaml | 4 ++-- plugins/anythingLLM/workspace/uninstall.yaml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/anythingLLM/config.yaml b/plugins/anythingLLM/config.yaml index c9dd22e..322ca74 100644 --- a/plugins/anythingLLM/config.yaml +++ b/plugins/anythingLLM/config.yaml @@ -8,8 +8,8 @@ all: vars: docker_download_url: - x86_64: https://download.docker.com/linux/static/stable/x86_64/docker-26.1.4.tgz - aarch64: https://download.docker.com/linux/static/stable/aarch64/docker-26.1.4.tgz + x86_64: https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/docker-26.1.4-x86_64.tgz + aarch64: https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/docker-26.1.4-aarch64.tgz anythingLLM_image_url: aarch64: hub.oepkgs.net/oedeploy/mintplexlabs/aarch64/anythingllm x86_64: hub.oepkgs.net/oedeploy/mintplexlabs/x86_64/anythingllm diff --git a/plugins/anythingLLM/workspace/uninstall.yaml b/plugins/anythingLLM/workspace/uninstall.yaml index 5f07e77..165e8db 100644 --- a/plugins/anythingLLM/workspace/uninstall.yaml +++ b/plugins/anythingLLM/workspace/uninstall.yaml @@ -19,6 +19,13 @@ path: "{{ docker_download_path }}/docker_already_deploy.flag" register: docker_deploy_status + - name: delete temp file or script + shell: > + rm -rf {{ docker_download_path }}/download_docker.sh; + rm -rf {{ docker_download_path }}/docker.log; + rm -rf {{ docker_download_path }}/download.log; + rm -rf {{ docker_download_path }}/docker_already_deploy.flag + - name: kill docker process shell: killall dockerd ignore_errors: true @@ -31,4 +38,5 @@ rm -rf /usr/bin/containerd*; rm -rf /usr/bin/ctr; rm -rf /usr/bin/runc; + rm -rf /etc/docker/daemon.json when: not docker_deploy_status.stat.exists \ No newline at end of file -- Gitee