Skip to content

Commit

Permalink
bump b13
Browse files Browse the repository at this point in the history
  • Loading branch information
xmonader committed Nov 25, 2020
2 parents 086958a + c42f768 commit 11be30c
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 34 deletions.
20 changes: 20 additions & 0 deletions .typo-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is a sample .typo-ci.yml file, it's used to configure how Typo CI will behave.
# Add it to the root of your project and push it to github.

# What language dictionaries should it use? Currently Typo CI supports:
# en

dictionaries:
- en

# Any files/folders we should ignore?
excluded_files:
- "*.py"
- ".typo-ci.yml"

# Any typos we should ignore?
excluded_words:
- typoci

# Would you like filenames to also be spellchecked?
spellcheck_filenames: true
9 changes: 6 additions & 3 deletions jumpscale/clients/explorer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,12 @@ def resource_units(self):
9: {"cru": 8, "mru": 32, "sru": 100},
10: {"cru": 8, "mru": 32, "sru": 200},
11: {"cru": 8, "mru": 32, "sru": 800},
12: {"cru": 1, "mru": 64, "sru": 200},
13: {"cru": 1, "mru": 64, "sru": 400},
14: {"cru": 1, "mru": 64, "sru": 800},
12: {"cru": 16, "mru": 64, "sru": 200},
13: {"cru": 16, "mru": 64, "sru": 400},
14: {"cru": 16, "mru": 64, "sru": 800},
15: {"cru": 1, "mru": 2, "sru": 25},
16: {"cru": 2, "mru": 4, "sru": 50},
17: {"cru": 4, "mru": 8, "sru": 50},
}

resource_units = ResourceUnitAmount()
Expand Down
11 changes: 6 additions & 5 deletions jumpscale/install/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM threefoldtech/phusion:20.04

ARG BRANCH
RUN apt-get update && apt-get install curl wget git python3-pip python3-venv redis-server tmux nginx restic musl musl-tools -y
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && cp ~/.cargo/bin/* /usr/local/bin/
RUN apt-get update && apt-get install curl wget git python3-pip python3-venv redis-server tmux nginx restic -y

RUN pip3 install poetry
RUN mkdir -p /sandbox/code/github/threefoldtech
RUN git clone https://github.com/threefoldtech/zinit.git /sandbox/code/github/threefoldtech/zinit -b master
WORKDIR /sandbox/code/github/threefoldtech/zinit
RUN make && cp target/x86_64-unknown-linux-musl/release/zinit /sbin/zinit

RUN git clone https://github.com/threefoldtech/js-sdk.git /sandbox/code/github/threefoldtech/js-sdk -b $BRANCH
WORKDIR /sandbox/code/github/threefoldtech/js-sdk
RUN poetry config virtualenvs.create false && poetry install
RUN poetry shell
RUN /etc/init.d/redis-server start
RUN python3 jumpscale/install/codeserver-install.py

RUN wget https://github.com/threefoldtech/zinit/releases/download/v0.1/zinit -O /sbin/zinit \
&& chmod +x /sbin/zinit

COPY rootfs /

ENTRYPOINT [ "zinit", "init" ]
1 change: 0 additions & 1 deletion jumpscale/packages/marketplace/chats/gitea.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def _deploy(self):
env=var_dict,
interactive=False,
entrypoint="/start_gitea.sh",
public_ipv6=True,
disk_size=self.container_resources["sru"] * 1024,
secret_env={"POSTGRES_PASSWORD": self.database_password},
solution_uuid=self.solution_id,
Expand Down
1 change: 0 additions & 1 deletion jumpscale/packages/marketplace/chats/mattermost.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def _deploy(self):
interactive=False,
entrypoint="/start_mattermost.sh",
volumes=volume_config,
public_ipv6=True,
solution_uuid=self.solution_id,
**self.solution_metadata,
)
Expand Down
1 change: 0 additions & 1 deletion jumpscale/packages/marketplace/chats/meetings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def _deploy(self):
disk_size=self.resources["sru"] * 1024,
interactive=False,
entrypoint="/entrypoint.sh",
public_ipv6=True,
solution_uuid=self.solution_id,
**self.solution_metadata,
)
Expand Down
1 change: 0 additions & 1 deletion jumpscale/packages/marketplace/chats/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def _deploy(self):
secret_env=secret_env,
interactive=False,
solution_uuid=self.solution_id,
public_ipv6=True,
**self.solution_metadata,
)
)
Expand Down
1 change: 0 additions & 1 deletion jumpscale/packages/marketplace/chats/taiga.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def _deploy(self):
env=var_dict,
interactive=False,
entrypoint="/start_taiga.sh",
public_ipv6=True,
secret_env={
"EMAIL_HOST_PASSWORD": self.EMAIL_HOST_PASSWORD,
"PRIVATE_KEY": private_key,
Expand Down
2 changes: 1 addition & 1 deletion jumpscale/packages/tfgrid_solutions/chats/gollum.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def gollum_network(self):
def public_key_get(self):
self.public_key = self.upload_file(
"""Please upload your public SSH key to be able to access the depolyed container via ssh""", required=True
).split("\n")[0]
).strip()

@chatflow_step(title="Email")
def gollum_email(self):
Expand Down
2 changes: 1 addition & 1 deletion jumpscale/packages/tfgrid_solutions/chats/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def public_key_get(self):
"""Please upload your public SSH key to be able to access the depolyed container via ssh
Note: please use keys compatible with Dropbear server eg: RSA""",
required=True,
).split("\n")
).splitlines()

self.cluster_secret = self.string_ask("Please add the cluster secret", default="secret", required=True)

Expand Down
2 changes: 1 addition & 1 deletion jumpscale/packages/tfgrid_solutions/chats/minio.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def public_key(self):
Just upload the file with the key. (Optional)"""
)
if public_key_file:
self.public_ssh_key = public_key_file.split("\n")[0]
self.public_ssh_key = public_key_file.strip()
else:
self.public_ssh_key = ""

Expand Down
2 changes: 1 addition & 1 deletion jumpscale/packages/tfgrid_solutions/chats/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def public_key_get(self):
Just upload the file with the key.
Note: please use keys compatible with Dropbear server eg: rsa """,
required=True,
).split("\n")[0]
).strip()

@chatflow_step(title="Prometheus container resources")
def prometheus_container_resources(self):
Expand Down
2 changes: 1 addition & 1 deletion jumpscale/packages/tfgrid_solutions/chats/ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def container_logs(self):
def public_key_get(self):
self.public_key = self.upload_file(
"""Please upload your public SSH key to be able to access the depolyed container via ssh""", required=True,
).split("\n")[0]
).strip()

@chatflow_step(title="Global IPv6 Address")
def ipv6_config(self):
Expand Down
3 changes: 1 addition & 2 deletions jumpscale/packages/threebot_deployer/chats/threebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def _threebot_start(self):
self.query = {"cru": 2, "mru": 2, "sru": 2.25}
self.container_resources = {"cru": 1, "mru": 1, "sru": 2}
self.expiration = 60 * 60 # 60 minutes for 3bot
self.ip_version = "IPv6"
self.retries = 3
self.allow_custom_domain = False
self.custom_domain = False
Expand Down Expand Up @@ -232,7 +231,7 @@ def _select_farm(self):

@chatflow_step(title="Deployment location policy")
def choose_location(self):
self._get_available_farms()
self._get_available_farms(only_one=False)
self.farms_by_continent = deployer.group_farms_by_continent(self.available_farms)
choices = ["Automatic", "Farm", "Specific node"]
if self.farms_by_continent:
Expand Down
12 changes: 4 additions & 8 deletions jumpscale/sals/marketplace/apps_chatflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def _init_solution(self):
self.username = self.user_info()["username"]
self.solution_metadata["owner"] = self.username
self.threebot_name = j.data.text.removesuffix(self.username, ".3bot")
self.ip_version = "IPv6"
self.expiration = 60 * 60 * 3 # expiration 3 hours
self.retries = 3
self.custom_domain = False
Expand Down Expand Up @@ -159,7 +158,7 @@ def _get_pool(self):
return self.pool_id

def _select_node(self):
self.selected_node = deployer.schedule_container(self.pool_id, ip_version=self.ip_version, **self.query)
self.selected_node = deployer.schedule_container(self.pool_id, **self.query)

@chatflow_step(title="New Expiration")
def set_expiration(self):
Expand Down Expand Up @@ -317,7 +316,7 @@ def _get_domain(self):
else:
deployer.unblock_managed_domain(domain)
try:
if j.sals.crtsh.has_reached_limit(domain):
if not j.core.config.get("TEST_CERT") and j.sals.crtsh.has_reached_limit(domain):
continue
except requests.exceptions.HTTPError:
is_http_failure = True
Expand Down Expand Up @@ -439,12 +438,9 @@ def _get_available_farms(self, only_one=True, identity_name=None):
for farm in farms:
farm_name = farm.name
available_ipv4, _, _, _, _ = deployer.check_farm_capacity(
farm_name, currencies=[self.currency], ip_version="IPv4"
farm_name, currencies=[self.currency], ip_version="IPv4", **self.query
)
available_ipv6, _, _, _, _ = deployer.check_farm_capacity(
farm_name, currencies=[self.currency], ip_version="IPv6", **self.query
)
if available_ipv4 and available_ipv6:
if available_ipv4:
self.available_farms.append(farm)
if only_one:
return
Expand Down
6 changes: 3 additions & 3 deletions jumpscale/sals/reservation_chatflow/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,10 @@ def deploy_network(self, name, access_node, ip_range, ip_version, pool_id, ident
wg_quick = j.sals.zos.get(identity_name).network.add_access(
network, access_node.node_id, str(next(node_subnets)), ipv4=use_ipv4
)

network_config["wg"] = wg_quick
j.sals.fs.mkdir(f"{j.core.dirs.CFGDIR}/wireguard/")
j.sals.fs.write_file(f"{j.core.dirs.CFGDIR}/{name}.conf", f"{wg_quick}")
wg_dir = j.sals.fs.join_paths(j.core.dirs.CFGDIR, "wireguard")
j.sals.fs.mkdirs(wg_dir)
j.sals.fs.write_file(j.sals.fs.join_paths(wg_dir, f"{identity_name}_{name}.conf"), wg_quick)

ids = []
parent_id = None
Expand Down
2 changes: 1 addition & 1 deletion jumpscale/sals/zos/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def add_master(
Input: if size is not supported
"""
if size not in range(1, 15):
if size not in range(1, 18):
raise Input(f"VM size {size} is not supported")

master = K8s()
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[tool.poetry]
name = "js-sdk"
packages = [{ include = "jumpscale" }]

version = "11.0b12"
version = "11.0b13"
description = "SDK for threefold grid"
authors = ["xmonader <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 11be30c

Please sign in to comment.