-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
441 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# docker build --no-cache --progress=plain -t caravanacloud/up -f Containerfile . | ||
# docker run -it --rm caravanacloud/up echo uala | ||
|
||
FROM registry.fedoraproject.org/fedora:38 | ||
|
||
RUN sudo dnf -y install python3 python3-pip | ||
#RUN python3 --version | ||
|
||
ARG YOUR_ENV | ||
ARG POETRY_VERSION=1.6.1 | ||
ENV YOUR_ENV=${YOUR_ENV} \ | ||
PYTHONFAULTHANDLER=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONHASHSEED=random \ | ||
PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
POETRY_VERSION=${POETRY_VERSION} | ||
RUN pip3 install "poetry==$POETRY_VERSION" | ||
|
||
RUN mkdir -p /opt/up | ||
WORKDIR /opt/up | ||
|
||
COPY . . | ||
|
||
WORKDIR /opt/up/up_cli | ||
RUN ls | ||
RUN poetry config virtualenvs.create false | ||
# --without dev | ||
RUN poetry install | ||
|
||
ENTRYPOINT ["poetry", "--quiet", "run", "python3", "-m", "up_cli.main"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
# docker build --no-cache --progress=plain -t caravanacloud/up_rh -f Containerfile . | ||
FROM registry.fedoraproject.org/fedora:38 | ||
|
||
# Java | ||
ARG JAVA_SDK="21-graalce" | ||
RUN curl -s "https://get.sdkman.io" | bash | ||
RUN bash -c "sdk install java $JAVA_SDK \ | ||
&& sdk default java $JAVA_SDK \ | ||
&& sdk install quarkus \ | ||
&& sdk install maven \ | ||
" | ||
|
||
|
||
# OpenShift Installer | ||
RUN bash -c "mkdir -p '/tmp/openshift-installer' \ | ||
&& wget -nv -O '/tmp/openshift-installer/openshift-install-linux.tar.gz' 'https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/openshift-install-linux.tar.gz' \ | ||
&& tar zxvf '/tmp/openshift-installer/openshift-install-linux.tar.gz' -C '/tmp/openshift-installer' \ | ||
&& sudo mv '/tmp/openshift-installer/openshift-install' '/usr/local/bin/' \ | ||
&& rm '/tmp/openshift-installer/openshift-install-linux.tar.gz'\ | ||
" | ||
|
||
# Credentials Operator CLI | ||
RUN bash -c "mkdir -p '/tmp/ccoctl' \ | ||
&& wget -nv -O '/tmp/ccoctl/ccoctl-linux.tar.gz' 'https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/ccoctl-linux.tar.gz' \ | ||
&& tar zxvf '/tmp/ccoctl/ccoctl-linux.tar.gz' -C '/tmp/ccoctl' \ | ||
&& sudo mv '/tmp/ccoctl/ccoctl' '/usr/local/bin/' \ | ||
&& rm '/tmp/ccoctl/ccoctl-linux.tar.gz'\ | ||
" | ||
|
||
# OpenShift CLI | ||
RUN bash -c "mkdir -p '/tmp/oc' \ | ||
&& wget -nv -O '/tmp/oc/openshift-client-linux.tar.gz' 'https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/openshift-client-linux.tar.gz' \ | ||
&& tar zxvf '/tmp/oc/openshift-client-linux.tar.gz' -C '/tmp/oc' \ | ||
&& sudo mv '/tmp/oc/oc' '/usr/local/bin/' \ | ||
&& sudo mv '/tmp/oc/kubectl' '/usr/local/bin/' \ | ||
&& rm '/tmp/oc/openshift-client-linux.tar.gz' \ | ||
" | ||
|
||
# Red Hat OpenShift on AWS CLI | ||
RUN bash -c "mkdir -p '/tmp/rosa' \ | ||
&& wget -nv -O '/tmp/rosa/rosa-linux.tar.gz' 'https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/rosa/latest/rosa-linux.tar.gz' \ | ||
&& tar zxvf '/tmp/rosa/rosa-linux.tar.gz' -C '/tmp/rosa' \ | ||
&& sudo mv '/tmp/rosa/rosa' '/usr/local/bin/' \ | ||
&& rm '/tmp/rosa/rosa-linux.tar.gz' \ | ||
" | ||
|
||
# odo | ||
ARG ODO_URL="https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v3.10.0/odo-linux-amd64" | ||
RUN bash -c "curl -L ${ODO_URL} -o odo \ | ||
&& curl -L ${ODO_URL}.sha256 -o odo.sha256 \ | ||
&& echo "$(<odo.sha256) odo" | shasum -a 256 --check \ | ||
&& sudo install -o root -g root -m 0755 odo /usr/local/bin/odo \ | ||
" | ||
|
||
# OpenShift Local (crc) - no virt flags | ||
# ARG CRC_URL="https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz" | ||
# RUN bash -c "mkdir -p '/tmp/crc' \ | ||
# && wget -nv -O '/tmp/crc/crc-linux-amd64.tar.xz' '${CRC_URL}' \ | ||
# && tar xvf '/tmp/crc/crc-linux-amd64.tar.xz' -C '/tmp/crc' \ | ||
# && find '/tmp/crc' \ | ||
# && sudo mv /tmp/crc/crc-linux-*/crc '/usr/local/bin/' \ | ||
# && rm '/tmp/crc/crc-linux-amd64.tar.xz' \ | ||
# " | ||
|
||
|
||
# krew | ||
# RUN OS="$(uname | tr '[:upper:]' '[:lower:]')" && \ | ||
# ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && \ | ||
# curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" && \ | ||
# tar zxvf krew.tar.gz && \ | ||
# KREW=./krew-"${OS}_${ARCH}" && \ | ||
# "$KREW" install krew && \ | ||
# cp $HOME/.krew/bin/kubectl-krew /usr/local/bin/ | ||
# | ||
|
||
# Operator SDK | ||
RUN bash -c "brew install operator-sdk" | ||
|
||
# Helm, Terraform, Terragrunt | ||
RUN bash -c "brew install helm terraform terragrunt" | ||
|
||
# KAN https://github.com/redhat-developer/kam | ||
|
||
# Tackle | ||
# RUN bash -c 'git clone "https://github.com/kubernetes/test-infra" "/tmp/test-infra" \ | ||
# && cd /tmp/test-infra/prow/cmd/tackle \ | ||
# && go build -o tackle \ | ||
# && sudo mv tackle /usr/sbin/tackle \ | ||
# ' | ||
|
||
# ArgoCD and Tekton | ||
RUN bash -c "brew install argocd" | ||
RUN bash -c "sudo apt install -y tektoncd-cli \ | ||
&& tkn version" | ||
|
||
# Kustomize | ||
RUN bash -c "curl -s 'https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh' | bash" | ||
|
||
# AWS CLIs | ||
RUN bash -c "curl 'https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip' -o 'awscliv2.zip' && unzip awscliv2.zip \ | ||
&& sudo ./aws/install \ | ||
&& aws --version \ | ||
" | ||
|
||
RUN bash -c "npm install -g aws-cdk" | ||
|
||
ARG SAM_URL="https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip" | ||
RUN bash -c "curl -Ls '${SAM_URL}' -o '/tmp/aws-sam-cli-linux-x86_64.zip' \ | ||
&& unzip '/tmp/aws-sam-cli-linux-x86_64.zip' -d '/tmp/sam-installation' \ | ||
&& sudo '/tmp/sam-installation/install' \ | ||
&& sam --version" | ||
|
||
RUN bash -c "pip install cloudformation-cli cloudformation-cli-java-plugin cloudformation-cli-go-plugin cloudformation-cli-python-plugin cloudformation-cli-typescript-plugin" | ||
|
||
# Azure CLI | ||
RUN bash -c "curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash" | ||
|
||
# Aliyun CLI | ||
RUN bash -c "brew install aliyun-cli" | ||
|
||
# Google CLI | ||
RUN bash -c "curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-437.0.1-linux-x86_64.tar.gz \ | ||
&& tar -xf google-cloud-cli-437.0.1-linux-x86_64.tar.gz \ | ||
&& rm google-cloud-cli-437.0.1-linux-x86_64.tar.gz \ | ||
&& ./google-cloud-sdk/install.sh --quiet \ | ||
&& sudo ln -s /workspace/red-pod/google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud \ | ||
" | ||
|
||
# Oracle Cloud CLI | ||
RUN bash -c "brew install oci-cli" | ||
|
||
# Done :) | ||
RUN bash -c "echo 'done.'" | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[tool.poetry] | ||
name = "up-ansible" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Julio Faerman <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
Empty file.
Empty file.
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[tool.poetry] | ||
name = "up" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Julio Faerman <[email protected]>"] | ||
readme = "README.md" | ||
packages = [ | ||
{ include = "up_cli", from="./src/"} | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
pluggy = "^1.3.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.scripts] | ||
up = 'up_cli.main:main' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import sys | ||
import logging as log | ||
from datetime import datetime | ||
|
||
|
||
def print_help(): | ||
log.debug("Please please help me") | ||
|
||
def exit_cli(code=-1): | ||
if code: | ||
log.error("Exiting up cli with code %s", code) | ||
sys.exit(code) | ||
|
||
def init(): | ||
sys.set_int_max_str_digits(999999) | ||
level = log.DEBUG | ||
log.basicConfig(stream=sys.stderr, level=level) | ||
|
||
def main(): | ||
init() | ||
now = datetime.now() | ||
log.info(f"Starting UP cli at {now.isoformat()}") | ||
args = sys.argv | ||
len_args = len(args) | ||
if len_args < 1: | ||
print_help() | ||
exit_cli("NO_COMMAND_SPECIFIED") | ||
executable = args[0] | ||
line = args[1:] | ||
log.debug(f"executable: {executable}") | ||
log.debug(f"line: {line}") | ||
context = { | ||
"executable": executable | ||
} | ||
try: | ||
log.info("UP entrypoint reached") | ||
start_container() | ||
log.debug("UP done") | ||
except Exception as ex: | ||
exit_cli(333) | ||
|
||
def start_container(): | ||
log.info("Starting container") | ||
image = "caravanacloud/up_rh" | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
|
Empty file.
Oops, something went wrong.