Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace kubectl apply with mesheryctl app onboard command #48

Closed
wants to merge 22 commits into from

Conversation

alphaX86
Copy link
Member

@alphaX86 alphaX86 commented Apr 22, 2022

Signed-off-by: Aadhitya A aadhitya864@gmail.com

Description

This PR fixes #20

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@leecalcote
Copy link
Member

Does this behave as expected?

@alphaX86
Copy link
Member Author

I thought it has CI actions inbuilt. Will check and let you know, Lee

@gyohuangxin
Copy link
Member

@alphaX86 Hi, do you have any updates?

Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@alphaX86
Copy link
Member Author

Heads Up! The adapter port nos are temporary for now... Plus, I need to test the scripts in a VM to ensure it works fine and safe

Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@alphaX86 alphaX86 added area/ci Continuous integration | Build and release area/performance Performance management labels May 1, 2022
@alphaX86
Copy link
Member Author

alphaX86 commented May 3, 2022

I just have only one tiny doubt. How you'd login to meshery via "None" provider, without the usage of auth token? It drives me crazy as the --provider flag is missing in mesheryctl

Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@leecalcote
Copy link
Member

For Remote Provider, an infinite token can be assigned.

Signed-off-by: Aadhitya A <aadhitya864@gmail.com>
@gyohuangxin
Copy link
Member

@alphaX86 Ready to be reviewed? Have you checked if it works?

@alphaX86
Copy link
Member Author

I need to test them on a cloud shell but due to limits on my AWS free tier, I could not see them. Plus, some PRs need to be merged on Meshery repo in order to reflect here

@gyohuangxin any suggestions to test the shell script on a remote cloud system with k8s running. Mine has reached limits due to t2.micro CPU

@gyohuangxin
Copy link
Member

@alphaX86 Thanks.

some PRs need to be merged on Meshery repo in order to reflect here

So mesheryctl app onboard command cannot work at this stage, right?

@gyohuangxin any suggestions to test the shell script on a remote cloud system with k8s running. Mine has reached limits due to t2.micro CPU

The fastest way is to use this github action on your forked repo, you need to set enhance branch as the default branch, then you can enable action workflows in https://github.com/alphaX86/meshery-smp-action/actions. Then run configurable-benchmark-test, it will deploy k8s and run your changed scripts to deploy meshes and applications. This way doesn't need any other resource.
image

@alphaX86
Copy link
Member Author

alphaX86 commented May 12, 2022

Well.. Its system login, because app onboard needs a token to work. I introduced a provider flag and if its merged it'll be good to go for this script

@alphaX86
Copy link
Member Author

@alphaX86 Thanks.

some PRs need to be merged on Meshery repo in order to reflect here

So mesheryctl app onboard command cannot work at this stage, right?

@gyohuangxin any suggestions to test the shell script on a remote cloud system with k8s running. Mine has reached limits due to t2.micro CPU

The fastest way is to use this github action on your forked repo, you need to set enhance branch as the default branch, then you can enable action workflows in https://github.com/alphaX86/meshery-smp-action/actions. Then run configurable-benchmark-test, it will deploy k8s and run your changed scripts to deploy meshes and applications. This way doesn't need any other resource. image

I'll check it out. Thank you so much

@gyohuangxin
Copy link
Member

Well.. Its system login, because app onboard needs a token to work. I introduced a provider flag and if its merged it'll be good to go for this script

Is it there any workaround to let it work now? Because I will work on enabling other meshes and try to use mesheryctl to deploy meshes and apps these days.

@alphaX86
Copy link
Member Author

alphaX86 commented May 13, 2022

Ok, you'd need an infinite lifetime auth token to accomplish this, because system login is prompt based for now and it won't work on pure bash script. Though 'none' provider can be logged in, I had deep trouble to access via script which eventually failed on all methods

The token alone however, some folks only have it... @Revolyssup is there anyway to acquire this token?

@gyohuangxin
Copy link
Member

@alphaX86 Thanks for the information 👍 I have one infinite lifetime auth token in fact.

@alphaX86
Copy link
Member Author

Then it'd be easy for you 🙂👍 thanks @gyohuangxin

.github/workflows/scripts/istio_deploy.sh Outdated Show resolved Hide resolved
.github/workflows/scripts/linkerd_deploy.sh Outdated Show resolved Hide resolved
.github/workflows/scripts/osm_deploy.sh Outdated Show resolved Hide resolved
Co-authored-by: Xin Huang <xin1.huang@intel.com>
@alphaX86 alphaX86 marked this pull request as draft June 7, 2022 23:29
@gyohuangxin
Copy link
Member

@hershd23 Can you help try this?

1 similar comment
@gyohuangxin
Copy link
Member

@hershd23 Can you help try this?

@hershd23
Copy link
Contributor

Yep I'll give this a shot

@hershd23
Copy link
Contributor

hershd23 commented Jun 13, 2022

https://github.com/hershd23/meshery-smp-action/runs/6867611798?check_suite_focus=true#step:5:226

Currently the tmate step keeps on printing the link to connect to the common terminal. It doesn't reach the next task. Any fixes for this @alphaX86 ?

Edit :- Found a way by creating a file named continue in the project directory, is there a better way?

@hershd23
Copy link
Contributor

https://github.com/hershd23/meshery-smp-action/actions/runs/2490527037

@gyohuangxin @alphaX86 still getting familiar with the issue, pulled up @alphaX86 's latest changes and the pattern apply works fine. Checking for app onboard

curl -fsL https://run.linkerd.io/emojivoto.yml | kubectl apply -f -
kubectl -n emojivoto port-forward svc/web-svc 8080:80 &> /dev/null &
kubectl get -n emojivoto deploy -o yaml | linkerd inject - | kubectl apply -f -
curl -fsL https://run.linkerd.io/emojivoto.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curl command isn't putting the output in a file. For reference :- https://github.com/hershd23/meshery-smp-action/runs/6868074975?check_suite_focus=true#step:4:285

We can add it explicitly like shown

Suggested change
curl -fsL https://run.linkerd.io/emojivoto.yml
curl -fsL https://run.linkerd.io/emojivoto.yml --output emojivoto.yml

@hershd23
Copy link
Contributor

https://github.com/hershd23/meshery-smp-action/runs/6868235120?check_suite_focus=true

Linkerd + wrk2 combination working fine with app onboard

Are there specific cases that are not working @gyohuangxin @alphaX86 @leecalcote, that I should test?

@alphaX86
Copy link
Member Author

https://github.com/hershd23/meshery-smp-action/runs/6867611798?check_suite_focus=true#step:5:226

Currently the tmate step keeps on printing the link to connect to the common terminal. It doesn't reach the next task. Any fixes for this @alphaX86 ?

Edit :- Found a way by creating a file named continue in the project directory, is there a better way?

Tmate is used to debug the current session actually @hershd23 that is, you need to open the link and type :wq then the shell will be activated. Once you finished debugging you need to exit the shell by exit command. Then only it'll proceed to next step of action

@alphaX86
Copy link
Member Author

alphaX86 commented Jun 14, 2022

https://github.com/hershd23/meshery-smp-action/runs/6868235120?check_suite_focus=true

Linkerd + wrk2 combination working fine with app onboard

Are there specific cases that are not working @gyohuangxin @alphaX86 @leecalcote, that I should test?

Check for Istio config and let us know :) I'm just busy with exams this whole month that's why seeking help from you @hershd23 ... :)

@gyohuangxin
Copy link
Member

@hershd23 Thanks for this testing, I saw the 500 error message in your testing of mesheryctl pattern apply on Istio: https://github.com/hershd23/meshery-smp-action/runs/6867816269?check_suite_focus=true#step:4:69. Did you check whether the pattern is working well?

@gyohuangxin
Copy link
Member

https://github.com/hershd23/meshery-smp-action/runs/6868235120?check_suite_focus=true

Linkerd + wrk2 combination working fine with app onboard

Are there specific cases that are not working @gyohuangxin @alphaX86 @leecalcote, that I should test?

IOM, the app onboard or pattern apply can achieve our goal. We prefer pattern apply because we can implement more interesting things on it in the future. Therefore, we should make sure at this time:

  1. We can use mesheryctl to deploy each mesh (Istio, Linkerd, OSM) in github action. Make sure this command works well: https://github.com/layer5io/meshery-smp-action/pull/48/files#diff-9708a03424bc77988703c3ef86daa584385ea618a3d48e55842e537d22620444R14
  2. We can use pattern apply to deploy pattern on each mesh and the performance tests works well.

@hershd23
Copy link
Contributor

@gyohuangxin you're right

Basically the pattern apply command is erroring out, the trace isn't helpful

runner@fv-az204-655:~/work/meshery-smp-action/meshery-smp-action$ mesheryctl pattern apply -f "https://github.com/service-mesh-patterns/service-mesh-patterns/blob/master/samples/bookInfoPattern.yaml" --token "./.github/workflows/auth.json"
Error: Response Status Code 500, possible Server Error

@hershd23
Copy link
Contributor

meshery-7bfb4d5c9c-dzplb        |       time="2022-06-14T18:10:00Z" level=error msg="readdirent /tmp/service-mesh-patterns/1655230199991602250/samples/bookInfoPattern.yaml: not a directory" app=meshery code=2167 probable-cause="Cannot save the Pattern due to wrong path or URL" severity=2 short-description="Error failed to import pattern" suggested-remediation="Check if the given path or URL of the Pattern is correct"
meshery-7bfb4d5c9c-dzplb        |       time="2022-06-14T18:12:52Z" level=error msg="readdirent /tmp/service-mesh-patterns/1655230372443385636/samples/bookInfoPattern.yaml: not a directory" app=meshery code=2167 probable-cause="Cannot save the Pattern due to wrong path or URL" severity=2 short-description="Error failed to import pattern" suggested-remediation="Check if the given path or URL of the Pattern is correct"
meshery-7bfb4d5c9c-dzplb        |       time="2022-06-14T18:12:55Z" level=error msg="readdirent /tmp/service-mesh-patterns/1655230375138899338/samples/bookInfoPattern.yaml: not a directory" app=meshery code=2167 probable-cause="Cannot save the Pattern due to wrong path or URL" severity=2 short-description="Error failed to import pattern" suggested-remediation="Check if the given path or URL of the Pattern is correct"

Checked the system logs got this

@hershd23
Copy link
Contributor

runner@fv-az204-655:~/work/meshery-smp-action/meshery-smp-action$ mesheryctl pattern apply -f "https://raw.githubusercontent.com/service-mesh-patterns/service-mesh-patterns/master/samples/bookInfoPattern.yaml" --token "./.github/workflows/auth.json"
pattern successfully applied
successfully deployed application productpage
successfully deployed application reviews-v1
successfully deployed application reviews-v3
successfully deployed application details
successfully deployed application ratings
created Gateway "sample-app-gateway" in namespace "default"
applied trait "meshmap" on service "reviews-v2"
applied trait "meshmap" on service "reviews-v3"
applied trait "meshmap" on service "reviews"
applied trait "meshmap" on service "reviews-v1"
applied trait "meshmap" on service "productpage"
applied trait "meshmap" on service "ratings"
applied trait "meshmap" on service "sample-app-gateway"
applied trait "meshmap" on service "bookinfo-vs"
applied trait "meshmap" on service "details"
created VirtualService "bookinfo-vs" in namespace "default"
applied trait "meshmap" on service "reviews-v2"
applied trait "meshmap" on service "reviews-v3"
applied trait "meshmap" on service "reviews"
applied trait "meshmap" on service "reviews-v1"
applied trait "meshmap" on service "productpage"
applied trait "meshmap" on service "ratings"
applied trait "meshmap" on service "sample-app-gateway"
applied trait "meshmap" on service "bookinfo-vs"
applied trait "meshmap" on service "details"
successfully deployed application reviews-v2
runner@fv-az204-655:~/work/meshery-smp-action/meshery-smp-action$ kubectl get pods
NAME                           READY   STATUS              RESTARTS   AGE
details-69648f48b4-rc8qf       0/1     ContainerCreating   0          4s
productpage-76dc999cf7-4j4d6   0/1     ContainerCreating   0          4s
ratings-6dfcc745f-drn9k        0/1     ContainerCreating   0          4s
reviews-v1-dbcdfd648-9shdd     0/1     ContainerCreating   0          4s
reviews-v2-7bb7dd9fc-jfnjz     0/1     ContainerCreating   0          4s
reviews-v3-784c4996f9-4rqhm    0/1     ContainerCreating   0          4s

Ah simply changing to download from raw file works!

https://raw.githubusercontent.com/service-mesh-patterns/service-mesh-patterns/master/samples/bookInfoPattern.yaml

@hershd23
Copy link
Contributor

hershd23 commented Jun 14, 2022

The run is successful, more importantly we are sure that the pattern got applied

It has an error towards the end, I don't know how relevant that is

https://github.com/hershd23/meshery-smp-action/runs/6886559987?check_suite_focus=true#step:6:1709

Error getting context: json: cannot unmarshal array into Go value of type map[string]interface {}

Any ideas @gyohuangxin @alphaX86 @leecalcote ?

@hershd23
Copy link
Contributor

Another comment, I feel for mesheryctl pattern apply one of the most basic errors would be that the URL is wrong or the file cannot be downloaded from that URL. We should have a better error message :)

runner@fv-az204-655:~/work/meshery-smp-action/meshery-smp-action$ mesheryctl pattern apply -f "https://github.com/service-mesh-patterns/service-mesh-patterns/blob/master/samples/bookInfoPattern.yaml" --token "./.github/workflows/auth.json"
Error: Response Status Code 500, possible Server Error

@hershd23
Copy link
Contributor

@gyohuangxin should I also change the linkerd task from app onboard to pattern apply and test?

Or let it be as is?

@hershd23
Copy link
Contributor

Also should I be making my own PR on this issue? Or suggest changes to this one itself? Not sure of @alphaX86 's availability due to his exams

@gyohuangxin
Copy link
Member

@gyohuangxin should I also change the linkerd task from app onboard to pattern apply and test?

Or let it be as is?

Yes, we should keep the method of deployment the same and also test on OSM.

@gyohuangxin
Copy link
Member

Also should I be making my own PR on this issue? Or suggest changes to this one itself? Not sure of @alphaX86 's availability due to his exams

Your own PR makes sense.

@alphaX86
Copy link
Member Author

You're cleared to make a PR @hershd23 I'll close this staled one

@alphaX86
Copy link
Member Author

alphaX86 commented Oct 11, 2022 via email

@gyohuangxin
Copy link
Member

@alphaX86 Thank you very much!

@alphaX86
Copy link
Member Author

Strange.... I sent the above mail comment 2-3 months ago. Seems a bug within GitHub :/ anyway the changes are already merged in other way

@gyohuangxin
Copy link
Member

@alphaX86 OK fine, but the scripts doesn't work indeed recently. We tried to debug but have no idea, https://layer5io.slack.com/archives/CVBGPTFJN/p1665299033777169?thread_ts=1664371772.250329&cid=CVBGPTFJN, can you have a look if you have some cycles

@alphaX86
Copy link
Member Author

alphaX86 commented Oct 13, 2022

Got it 👍

@gyohuangxin
Copy link
Member

Got it 👍

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci Continuous integration | Build and release area/performance Performance management
Development

Successfully merging this pull request may close these issues.

Use mesheryctl not bash
4 participants