Skip to content

Commit 8ba5f5d

Browse files
authored
Merge pull request #793 from kitsudaiki/feat/local-test-automation
related issue: #711
2 parents be4abd7 + 9da001a commit 8ba5f5d

95 files changed

Lines changed: 1034 additions & 207 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ target
1010
.vite
1111
venv
1212
.venv
13+
.vagrant
1314

15+
temporary_files
1416
testing/go_cli_api/ainarictl
1517
testing/ansible_deploy/.vagrant/
1618

@@ -24,6 +26,7 @@ src/sdk/python/ainari_sdk/ainari_messages
2426
gitIdentityChange.sh
2527
proto3_pb2.py
2628
CMakeLists.txt.user*
29+
ainari_docker_files.tar
2730

2831
*.proto3.pb.go
2932
*.qmake2cmake
@@ -38,3 +41,4 @@ CMakeLists.txt.user*
3841
*.whl
3942
*.orig
4043
*.egg-info
44+

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Added
6+
7+
- Vagrantfile with ansible playbook to deploy multiple virtual machines with a kubernestes with fully deployed ainari-setup and sdk-api-test
8+
- image pull-policy can now be changed by the helm-values
9+
10+
### Changed
11+
12+
- changed the image-build process for the new vagrant-test-setup
13+
314
## v0.10.0
415

516
(Changes since v0.9.0)

Vagrantfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright 2022 Tobias Anker <tobias.anker@kitsunemimi.moe>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License")
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Run host-side script first in "vagrant up"-command
16+
if ARGV.any? { |arg| arg == "up" }
17+
puts "Building Docker images before vagrant up..."
18+
system("./scripts/build_docker_images.sh") or abort("build_docker_images.sh failed, stopping!")
19+
end
20+
21+
Vagrant.configure("2") do |config|
22+
# There is no official debian 13 image for vagrant, because of the license-change
23+
# Used this alternative images instead: https://github.com/alchemy-solutions/vagrant-cloud-images
24+
config.vm.box = "cloud-image/debian-13"
25+
26+
nodes = {
27+
"server" => "192.168.56.10",
28+
"agent1" => "192.168.56.11",
29+
"agent2" => "192.168.56.12"
30+
}
31+
32+
nodes.each do |name, ip|
33+
config.vm.define name do |node|
34+
# Add three extra disks of 5G each in addition to the root disk for the onsen
35+
node.vm.provider :libvirt do |libvirt|
36+
libvirt.storage :file, size: "5G", name: "ainari-#{name}-vdb.qcow2"
37+
end
38+
39+
node.vm.hostname = name
40+
node.vm.network "private_network", ip: ip
41+
node.vm.provider "libvirt" do |vb|
42+
vb.memory = 4096
43+
vb.cpus = 4
44+
vb.storage :file, size: 10
45+
end
46+
end
47+
end
48+
49+
# Run provision.yml for the 'ainari-test' group
50+
config.vm.provision "ansible" do |ansible|
51+
ansible.playbook = "testing/vagrant/playbook.yaml"
52+
ansible.become = true
53+
54+
ansible.extra_vars = {
55+
ansible_python_interpreter: "/usr/bin/python3"
56+
}
57+
# ansible.verbose = "vvv"
58+
ansible.groups = {
59+
"k3s_server" => ["server"],
60+
"k3s_agents" => ["agent1", "agent2"]
61+
}
62+
end
63+
end

deploy/k8s/ainari/templates/dashboard/dashboard-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
containers:
3636
- name: dashboard
3737
image: {{ .Values.docker.registry }}/ainari_dashboard:{{ .Values.docker.tag }}
38-
imagePullPolicy: Always
38+
imagePullPolicy: {{ .Values.docker.pull_policy }}
3939
env:
4040
- name: RUST_LOG
4141
value: "debug"

deploy/k8s/ainari/templates/hanami/hanami-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
containers:
3636
- name: hanami
3737
image: {{ .Values.docker.registry }}/hanami:{{ .Values.docker.tag }}
38-
imagePullPolicy: Always
38+
imagePullPolicy: {{ .Values.docker.pull_policy }}
3939
env:
4040
- name: RUST_LOG
4141
value: "debug"

deploy/k8s/ainari/templates/miko/miko-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ data:
2020
file_path = "/etc/ainari/miko/miko_db"
2121
2222
[endpoints.hanami]
23-
public_address = "https://local-hanami:443"
23+
public_address = "https://{{ .Values.api.domain_hanami }}:443"
2424
internal_address = "https://hanami-tls-service.default.svc.cluster.local:8443"
2525
2626
[endpoints.ryokan]
27-
public_address = "https://local-ryokan:443"
27+
public_address = "https://{{ .Values.api.domain_ryokan }}:443"
2828
internal_address = "https://ryokan-tls-service.default.svc.cluster.local:8443"
2929
3030
[endpoints.torii]
31-
public_address = "https://local-torii:443"
31+
public_address = "https://{{ .Values.api.domain_torii }}:443"
3232
internal_address = "https://torii-tls-service.default.svc.cluster.local:8443"
3333
3434
[endpoints.omamori]
35-
public_address = "https://local-omamori:443"
35+
public_address = "https://{{ .Values.api.domain_omamori }}:443"
3636
internal_address = "https://omamori-tls-service.default.svc.cluster.local:8443"
3737
3838
kind: ConfigMap

deploy/k8s/ainari/templates/miko/miko-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
containers:
1818
- name: miko
1919
image: {{ .Values.docker.registry }}/miko:{{ .Values.docker.tag }}
20-
imagePullPolicy: Always
20+
imagePullPolicy: {{ .Values.docker.pull_policy }}
2121
env:
2222
- name: AINARI_ADMIN_ID
2323
value: {{ required "user.id is required!" .Values.user.id }}

deploy/k8s/ainari/templates/omamori/omamori-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
containers:
3636
- name: omamori
3737
image: {{ .Values.docker.registry }}/omamori:{{ .Values.docker.tag }}
38-
imagePullPolicy: Always
38+
imagePullPolicy: {{ .Values.docker.pull_policy }}
3939
env:
4040
- name: RUST_LOG
4141
value: "debug"

deploy/k8s/ainari/templates/onsen/onsen-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
containers:
3636
- name: onsen
3737
image: {{ .Values.docker.registry }}/onsen:{{ .Values.docker.tag }}
38-
imagePullPolicy: Always
38+
imagePullPolicy: {{ .Values.docker.pull_policy }}
3939
env:
4040
- name: RUST_LOG
4141
value: "debug,h2=info"

deploy/k8s/ainari/templates/ryokan/ryokan-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
containers:
3636
- name: ryokan
3737
image: {{ .Values.docker.registry }}/ryokan:{{ .Values.docker.tag }}
38-
imagePullPolicy: Always
38+
imagePullPolicy: {{ .Values.docker.pull_policy }}
3939
env:
4040
- name: RUST_LOG
4141
value: "debug,h2=info"

0 commit comments

Comments
 (0)