Skip to content

Commit

Permalink
Merge pull request #88 from picodata/85-instance-vars
Browse files Browse the repository at this point in the history
feat: cartridge_extra_env
  • Loading branch information
DmitryTravyan authored Nov 29, 2022
2 parents a1cf0ff + f125027 commit 56bb7fb
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "genin"
version = "0.4.9"
version = "0.4.10"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ sudo yum install -y genin
2. If you want to install `rpm` packages directly without adding our repository.
```shell
# RHEL 8.x, CentOS 8.x, Rockylinux 8.x, recent Fedora version
sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.7-1.el8.x86_64.rpm
sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.10-1.el8.x86_64.rpm
# RHEL 7.x, CentOS 7.x
sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.7-1.el7.x86_64.rpm
sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.10-1.el7.x86_64.rpm
```
> **Note:** please don't forget to pick the right package for your OS version.
#### Debian, Ubuntu
We provide the `deb` Genin package for `debian`-based Linux distributions including the Ubuntu family. Use the following command to download and install the package:
```shell
curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.7.amd64.deb && sudo dpkg -i genin-0.4.7.amd64.deb
curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.10.amd64.deb && sudo dpkg -i genin-0.4.10.amd64.deb
```

#### MacOSX
Expand All @@ -92,8 +92,8 @@ brew install genin
Use the following command to grab and install Genin in macOS (10.10+) wihtout
homebrew:
```shell
curl -L https://binary.picodata.io/repository/raw/genin/apple/genin-0.4.7-darwin-amd64.zip -o genin-0.4.7-darwin-amd64.zip
unzip genin-0.4.7-darwin-amd64.zip -d ~/bin/
curl -L https://binary.picodata.io/repository/raw/genin/apple/genin-0.4.10-darwin-amd64.zip -o genin-0.4.10-darwin-amd64.zip
unzip genin-0.4.10-darwin-amd64.zip -d ~/bin/
```
> **Note:** The application can then be found under the `~/bin` directory.
> Make sure the directory is in your `$PATH`.
Expand All @@ -102,8 +102,8 @@ unzip genin-0.4.7-darwin-amd64.zip -d ~/bin/
#### Windows
Use the following command to grab and install Genin in Windows 7 64 bit or newer:
```shell
curl.exe -L https://binary.picodata.io/repository/raw/genin/windows/genin-0.4.7-darwin-amd64.zip -o genin-0.4.7-windows-amd64.zip
unzip.exe genin-0.4.7-windows-amd64.zip -d %HOME%/.cargo/bin/
curl.exe -L https://binary.picodata.io/repository/raw/genin/windows/genin-0.4.10-darwin-amd64.zip -o genin-0.4.10-windows-amd64.zip
unzip.exe genin-0.4.10-windows-amd64.zip -d %HOME%/.cargo/bin/
```
> **Note:** The application can then be found under the `.cargo/bin` folder inside
> your user profile folder. Make sure it is in your `%PATH%`.
Expand Down
22 changes: 11 additions & 11 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Genin уже заранее скомпилирован под разные ар

Универсальный исполняемый файл:
```shell
curl -sLO https://binary.picodata.io/repository/raw/genin/bin/genin-0.4.7-x86_64-musl.tar.gz
tar -xvf genin-0.4.7-x86_64-musl.tar.gz ; sudo install genin /usr/local/bin/
curl -sLO https://binary.picodata.io/repository/raw/genin/bin/genin-0.4.10-x86_64-musl.tar.gz
tar -xvf genin-0.4.10-x86_64-musl.tar.gz ; sudo install genin /usr/local/bin/
```

---
Expand Down Expand Up @@ -84,11 +84,11 @@ sudo yum install -y genin
2. Так же вы можете установить пакет `rpm` напрямую без добавления нашего репозитория.
RHEL 8.x, CentOS 8.x, Rockylinux 8.x, recent Fedora version
```shell
sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.7-1.el8.x86_64.rpm
sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.10-1.el8.x86_64.rpm
```
RHEL 7.x, CentOS 7.x
```shell
sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.7-1.el7.x86_64.rpm
sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.10-1.el7.x86_64.rpm
```
> **Note:** будьте внимательны, так как при выборе не правильной версии ос могут быть ошибки
> при установке `rpm`
Expand All @@ -115,7 +115,7 @@ sudo apt install -y genin

2. Загрузкой и установкой пакета напрямую:
```shell
curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.7.amd64.deb && sudo dpkg -i genin-0.4.7.amd64.deb
curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.10.amd64.deb && sudo dpkg -i genin-0.4.10.amd64.deb
```

---
Expand All @@ -140,7 +140,7 @@ sudo apt install -y genin

2. Загрузкой и установкой пакета напрямую:
```shell
curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.7.amd64.deb && sudo dpkg -i genin-0.4.7.amd64.deb
curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.10.amd64.deb && sudo dpkg -i genin-0.4.10.amd64.deb
```

---
Expand All @@ -160,8 +160,8 @@ brew install genin
Для установки без помощи homebrew используйте следующие команды для загрузки и установки
Genin на macOS (10.10+):
```shell
curl -sLO https://binary.picodata.io/repository/raw/genin/osx/genin-0.4.7-x86_64-macosx.tar.gz
unzip genin-0.4.7-darwin-amd64.zip -d ~/bin/
curl -sLO https://binary.picodata.io/repository/raw/genin/osx/genin-0.4.10-x86_64-macosx.tar.gz
unzip genin-0.4.10-darwin-amd64.zip -d ~/bin/
```

---
Expand All @@ -175,8 +175,8 @@ unzip genin-0.4.7-darwin-amd64.zip -d ~/bin/
Используйте следующие команды для скачивания и установки Genin на операционных системах
Windows 7 64 и новее.
```shell
curl.exe -sLO https://binary.picodata.io/repository/raw/genin/win/genin-0.4.7-win64.zip
unzip.exe genin-0.4.7-win64.zip -d %HOME%/.cargo/bin/
curl.exe -sLO https://binary.picodata.io/repository/raw/genin/win/genin-0.4.10-win64.zip
unzip.exe genin-0.4.10-win64.zip -d %HOME%/.cargo/bin/
```
> **Note:** Genin будет распакован в директорию `.cargo/bin` которая находится в домашнем
> каталоге важего пользователя. Перед использованием приложения пожалуйста удостоверьтесь
Expand All @@ -186,7 +186,7 @@ unzip.exe genin-0.4.7-win64.zip -d %HOME%/.cargo/bin/
```
genin --version
```
Если вы видите сообщение `genin 0.4.7` значит установка прошла успешно.
Если вы видите сообщение `genin 0.4.10` значит установка прошла успешно.

---
## Руководство по использованию
Expand Down
3 changes: 3 additions & 0 deletions src/task/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ impl<'a> TryFrom<&'a Option<Inventory>> for Cluster {
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: instance.vars.clone(),
config: InstanceV2Config::from(
&instance.config,
),
Expand Down Expand Up @@ -443,6 +444,7 @@ impl Cluster {
weight,
failure_domains,
roles,
cartridge_extra_env,
config,
vars,
..
Expand All @@ -452,6 +454,7 @@ impl Cluster {
weight: *weight,
failure_domains: failure_domains.clone(),
roles: roles.clone(),
cartridge_extra_env: cartridge_extra_env.clone(),
config: InstanceV2Config {
http_port: None,
binary_port: None,
Expand Down
25 changes: 25 additions & 0 deletions src/task/cluster/hst/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -176,6 +177,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -189,6 +191,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -202,6 +205,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -215,6 +219,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -228,6 +233,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -241,6 +247,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -254,6 +261,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -267,6 +275,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -280,6 +289,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand Down Expand Up @@ -415,6 +425,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -428,6 +439,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -441,6 +453,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -454,6 +467,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -467,6 +481,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -480,6 +495,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -493,6 +509,7 @@ hosts:
weight: None,
failure_domains: Vec::new(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -506,6 +523,7 @@ hosts:
weight: None,
failure_domains: vec!["dc-2".to_string()],
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -519,6 +537,7 @@ hosts:
weight: None,
failure_domains: vec!["dc-2".to_string()],
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand Down Expand Up @@ -608,6 +627,7 @@ fn hosts_v2_spreading() {
weight: None,
roles: vec![Role::router(), Role::failover_coordinator()],
failure_domains: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config {
http_port: Some(8081),
binary_port: Some(3031),
Expand All @@ -625,6 +645,7 @@ fn hosts_v2_spreading() {
weight: None,
roles: vec![Role::storage()],
failure_domains: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config {
http_port: Some(8082),
binary_port: Some(3032),
Expand All @@ -642,6 +663,7 @@ fn hosts_v2_spreading() {
weight: None,
roles: vec![Role::storage()],
failure_domains: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config {
http_port: Some(8083),
binary_port: Some(3033),
Expand All @@ -664,6 +686,7 @@ fn hosts_v2_spreading() {
weight: None,
roles: vec![Role::storage()],
failure_domains: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand All @@ -677,6 +700,7 @@ fn hosts_v2_spreading() {
weight: None,
roles: vec![Role::storage()],
failure_domains: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View {
Expand Down Expand Up @@ -812,6 +836,7 @@ fn hosts_v2_spread_stateboard() {
weight: None,
failure_domains: vec![hosts_v2.get_name_by_address(&address).unwrap().to_string()],
roles: Vec::new(),
cartridge_extra_env: IndexMap::new(),
config: InstanceV2Config::default(),
vars: IndexMap::default(),
view: View::default(),
Expand Down
1 change: 1 addition & 0 deletions src/task/cluster/hst/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ impl HostV2 {
.map(|name| vec![name.to_string()])
.unwrap_or_default(),
roles: Vec::new(),
cartridge_extra_env: IndexMap::default(),
config: InstanceV2Config {
additional_config: vec![
(
Expand Down
Loading

0 comments on commit 56bb7fb

Please sign in to comment.