Skip to content

Commit

Permalink
reduced timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
mukrishn committed Nov 3, 2023
1 parent f19c5b8 commit b5f32e9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.11 as runtime
USER root
RUN curl -L https://go.dev/dl/go1.18.2.linux-amd64.tar.gz -o go1.18.2.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
RUN python3 -m pip install --upgrade pip || true
RUN yes | pip3 install openshift --upgrade || true
RUN apt-get -y update
RUN apt-get -y install jq
RUN curl -L $(curl -s https://api.github.com/repos/openshift/rosa/releases/latest | jq -r ".assets[] | select(.name == \"rosa-linux-amd64\") | .browser_download_url") --output /usr/local/bin/rosa
RUN curl -L $(curl -s https://api.github.com/repos/openshift-online/ocm-cli/releases/latest | jq -r ".assets[] | select(.name == \"ocm-linux-amd64\") | .browser_download_url") --output /usr/local/bin/ocm
RUN chmod +x /usr/local/bin/rosa && chmod +x /usr/local/bin/ocm
RUN /usr/local/bin/rosa download openshift-client
RUN tar xzvf openshift-client-linux.tar.gz
RUN mv oc kubectl /usr/local/bin/
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
COPY . /
10 changes: 5 additions & 5 deletions libs/platforms/rosa/terraform/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,15 @@ def create_cluster(self, platform, cluster_name):
os.mkdir(cluster_info["path"])
self.logging.debug("Output directory set to %s" % cluster_info["path"])

while retry_loop <= 600: # 1hr timeout
while retry_loop <= 60: # 10 min timeout
retry_loop += 1
cluster_start_time = int(datetime.datetime.utcnow().timestamp())
status_code, status_out, status_err = self.utils.subprocess_exec("rosa describe cluster -c " + cluster_name + " -o json", extra_params={"universal_newlines": True}, log_output=False)
if status_code != 0:
if retry_loop <= 600:
if retry_loop <= 60:
self.logging.debug(f"ROSA cluster {cluster_name} is not available yet, retrying..")
self.logging.debug(status_out)
time.sleep(6)
time.sleep(5)
else:
cluster_info['status'] = "not ready"
self.logging.debug(status_out)
Expand All @@ -342,8 +342,6 @@ def create_cluster(self, platform, cluster_name):
else:
cluster_listed_time = int(datetime.datetime.utcnow().timestamp())
preflight_ch = self._preflight_wait(cluster_name, cluster_name)
cluster_apply_time = int(platform.environment["clusters"][cluster_name]["cluster_apply_time"])
cluster_info["apply_duration"] = cluster_listed_time - cluster_apply_time
cluster_info["preflight_checks"] = preflight_ch
break

Expand Down Expand Up @@ -384,6 +382,8 @@ def create_cluster(self, platform, cluster_name):
cluster_info['status'] = "Ready, missing workers"
return 1
cluster_info['status'] = "ready"
cluster_apply_time = int(platform.environment["clusters"][cluster_name]["cluster_apply_time"])
cluster_info["apply_duration"] = cluster_listed_time - cluster_apply_time
try:
with open(cluster_info['path'] + "/metadata_install.json", "w") as metadata_file:
json.dump(cluster_info, metadata_file)
Expand Down

0 comments on commit b5f32e9

Please sign in to comment.