Skip to content

Commit

Permalink
Merge pull request #13 from willyguggenheim/fix_m1
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
willyguggenheim committed Jan 15, 2022
2 parents 90f86eb + d28948c commit 82b4540
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 57 deletions.
84 changes: 60 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,98 @@
![TURN_KEY_DEVOPS_RAPID_TESTER](./docs/img/README_md_imgs/kubify-arch.drawio.png)

# Awesome !!

Well hello there. Ready to Simulate AWS Cloud Locally??

# Welcome

# By Why ?
Well hello there! Welcome to Kubify. The Turn-Key DevOps OS Stack.

Because Docker-Compose and Terraform are 2 different tools (so I fixed it).
The world needs a fully Open Source and FREE DevOps Stack. Devs Approved.


# Future State?
# Awesome !!

Fork Terraform and build Docker-Compose, LocalStack & 🛹 Skater Hot Reloader into it.
Code faster than your Competition.

Fully Automated. First Class DevEx. Developers-First. Happy Devs. Fixes Spot. No more K8s pains.

# What do I need?
You need your own environment, you need to test in real environment, you need to modify multiple services at the same time (without waiting for builds), you need to know your commit works before pushing it and you need the entire cloud on your laptop to do so..

Mac, Linux, Windows or any Docker and AWS.

# By Why ?

Because Docker-Compose and Terraform are 2 different tools (so I fixed it).


# Dependencies For Runtime?
# Future State?

Fork Terraform and build Docker-Compose, LocalStack & 🛹 Skater Hot Reloader into it.


# What do I need?

Mac, Linux, Windows or any Docker and AWS.


# Dependencies For Runtime?

Just Docker (no admin rights required) !!


# Start Cloud

1) Create kms key(s) alias named like kubify_secrets_[env] (for each env)

2) `./kubify deploy_cloud dev`


# Stop Cloud

# Setup Your AWS Cloud
`./kubify delete_clouds_testing`


# Start Debugging

A) To install/run on your OS directly (brew): `./kubify up`

or

`./kubify deploy_cloud dev`
B) To install/run in a container (no admin rights): `./kubify up_container`


# Summary, Install/Reset Workstation
# Rapid Test

```
cd dev/svc/example-node-complex-svc
../../../kubify_verbose start
# open another terminal (because you need to work on another dependant service at the same time)
cd dev/svc/example-flask-svc
../../../kubify_verbose start
# make changes to both service's app folders (or any files/folders enabled in "sync" in kubify.yml)
```

`./kubify up` or `./kubify up_container`

# Stop Debugging

`./kubify down`


![FUTUREOFDEVOPS9000](./docs/img/README_md_imgs/the-future.gif)

Your own REAL FULL environment (local & cloud). Entire AWS Cloud on Your Workstation!!

# Hashtags, More Hashtags

Easy Cloud Env, Easy Patching, Easy Version Rollback and Quality Commits, FAST!!

The Future, NOW. Developer's Dreams are Coming True Here..

# Hashtags, More Hashtags
💻💻💻💻💻💻💻💻💻💻💻💻

#AUTOPILOTFORDEVOPS

#STAYINSPIRATIONAL

#FREESOFTWARE

#THEFUTURE

#DEVLOVE

#DEVEX

💻💻

🛹


🛹
2 changes: 2 additions & 0 deletions dev/svc/example-java-svc/kubify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: example-java-svc
init: |
echo "run migrations for example-java-svc/app"
depends_on:
- zookeeper-svc
dev:
# "sync" is if you want Kubify to listen for code changes (other option is
# using some cli listener for code changes in release.scripts.start)
Expand Down
2 changes: 2 additions & 0 deletions dev/svc/example-node-complex-svc/kubify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: example-node-complex-svc
init: |
echo "run init for example-node-complex-svc/app"
depends_on:
- zookeeper-svc
dev:
sync:
'app/***': 'app/'
Expand Down
2 changes: 1 addition & 1 deletion dev/svc/zookeeper-svc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "0.0.1",
"description": "Simulate AWS Services Locally",
"dependencies": {
"express": "^4.17.1"
"express": "^4.17.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@
#use the new depends_on feature..

- name: Deploying Cloudformation templates with deployCloudformation.sh
shell: "{{ app_kubify_dir }}/deployCloudformation.sh"
shell: "{{ app_kubify_dir }}/deployCloudformation.sh 2>/dev/null"
when: app_name is not search(".*localstack.*")
ignore_errors: true



Expand Down
45 changes: 14 additions & 31 deletions src/kubify/tool/kubify
Original file line number Diff line number Diff line change
Expand Up @@ -241,35 +241,8 @@ else
PROFILE=${KUBIFY_PROFILE:-default}
fi

git config --get user.name &> /dev/null
if [ $? -eq 1 ]; then
echo "What is your first and last name (for git config)?"
read -t 10 GIT_FIRST_LAST
FIRST_LAST=${GIT_FIRST_LAST}
git config --set user.name "${GIT_FIRST_LAST}" &> /dev/null || git config --set user.name "Iwas NeverGivenAname" &> /dev/null
git config --global user.name "${GIT_FIRST_LAST}" &> /dev/null || git config --global user.name "Iwas NeverGivenAname" &> /dev/null
fi

git config --get user.email &> /dev/null
if [ $? -eq 1 ]; then
echo "What is your email address (for git config)?"
read -t 10 GIT_EMAIL
EMAIL=${EMAIL}
git config --set user.email "${GIT_EMAIL}" &> /dev/null || git config --set user.email "[email protected]" &> /dev/null
git config --global user.email "${GIT_EMAIL}" &> /dev/null || git config --global user.email "[email protected]" &> /dev/null
fi

if ! [ -x "$(command -v git config --get user.email)" ]; then
echo "
!!ERROR:
Please configure your git first:
Make sure git key exists, example: stat ~/.ssh/id_rsa
Make sure permissions, example: chmod 600 ~/.ssh/id_rsa
Make sure your git user.name is set, example: git config --global user.name '[First Last]'
Make sure your git user.name is set, example: git config --global user.email '[Email]'
"
exit 1
fi
git config --get user.name | grep -E "[a-z]" || git config --global user.name "Set YourGitUsername"
git config --get user.email | grep -E "[a-z]" || git config --global user.email "[email protected]"

if [[ -z "${AWS_SECRET_ACCESS_KEY}" ]]; then
if [ ! -f ${HOME}/.aws/credentials ]; then
Expand Down Expand Up @@ -3148,8 +3121,8 @@ EOF

docker-compose up -d
docker ps | grep kubify-kubify-1
docker exec -it --privileged -w "/src/kubify" "kubify-kubify-1" ./kubify_verbose _up_container
docker exec -it --privileged -w "/src/kubify/dev/svc/localstack-aws-svc" "kubify-kubify-1" ../../../kubify_verbose run
docker exec -it --privileged -w "/src/kubify" "kubify-kubify-1" ./kubify _up_container
docker exec -it --privileged -w "/src/kubify/dev/svc/localstack-aws-svc" "kubify-kubify-1" ../../../kubify run
# docker exec -it --privileged -w "/src/kubify/dev/svc/localstack-aws-svc" "kubify-kubify-1" "../../../kubify run"

}
Expand Down Expand Up @@ -3294,6 +3267,16 @@ function deploy_cloud {

}

function delete_clouds_testing {

eksctl delete cluster --name "kubify-cpu-dev-west" --region us-west-2 &
eksctl delete cluster --name "kubify-gpu-dev-west" --region us-west-2 &
eksctl delete cluster --name "kubify-cpu-dev-east" --region us-east-1 &
eksctl delete cluster --name "kubify-gpu-dev-east" --region us-east-1 &
wait

}


####
# END OF CONTAINER MOD
Expand Down

0 comments on commit 82b4540

Please sign in to comment.