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

Test the full flow from a perspective of a Developer #47

Open
LucaLanziani opened this issue May 24, 2023 · 4 comments
Open

Test the full flow from a perspective of a Developer #47

LucaLanziani opened this issue May 24, 2023 · 4 comments
Assignees

Comments

@LucaLanziani
Copy link
Member

LucaLanziani commented May 24, 2023

Prerequisites:

  • A Kubernets cluster running K8s-kurated-addons [You can use k8s-kurated-addons dev environment]
  • Two, go or javascript, application repository in your personal github account

Tasks:

  • Use kka-cli to generate the github action that builds and push on main/master
  • Deploy the manifests with the above images from your local machine
  • Test that the two applications are running in the cluster

Output:

  • Write a markdown document with all the step needed to complete the task
  • This document will be added to the documentation and used by other Developers/DevOps
  • if manual steps are required or something in the tools don't work as expected create an issue in the relative repository
@heidermassu
Copy link

I've been configuring my local environment till now:

  • installed kubectl

  • installed docker desktop

  • installed wsl

  • installed argoCD

    • On instruction https://argo-cd.readthedocs.io/en/stable/getting_started/ There are instructions to run the command kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}' but I got error error: unable to parse "'{spec:": yaml: found unexpected end of stream so I edit the yaml kubectl edit svc argocd-server -n argocd changing the type for "LoadBalancer"
  • install tilt

  • instal asdf Install asdf-vm

    • git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
    • echo -e "\n. $HOME/.asdf/asdf.sh" >> ~/.bashrc
    • . $HOME/.asdf/asdf.sh
    • asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
    • asdf install nodejs 18.16.0
    • asdf global nodejs 18.16.0
    • after configuration make asdf_install got error:
      /argocd-linux-amd64tps://github.com/argoproj/argo-cd/releases/download/v2.7.1
      curl: (3) URL using bad/illegal format or missing URL
      not foundocd version 2.7.1
      make: *** [Makefile:58: asdf_install] Error 1
    • make ci get an error:
      heider@DESKTOP-IMMNRVM:/mnt/c/Users/heide/OneDrive/NearForm/HUB/k8s-kurated-addons$ make ci
      ./scripts/generate-certs.sh: line 2: $'\r': command not found
      : No such file or directory: line 3: .envrc
      ./scripts/generate-certs.sh: line 4: $'\r': command not found
      ./scripts/generate-certs.sh: line 6: $'\r': command not found
      : ambiguous redirecterts.sh: line 8: 1
      ./scripts/generate-certs.sh: line 36: warning: here-document at line 14 delimited by end-of-file (wanted EOF')
      ./scripts/generate-certs.sh: line 37: syntax error: unexpected end of file
      make: *** [Makefile:72: generate-certs] Error 2
      I have looked at other commands into .envrc and also tried and got same error

@heidermassu
Copy link

today using WSL version 2 with ubuntu were possible to create the environment

@heidermassu
Copy link

were created a branch from main called feature/task-47 which contains draft about output. branch

@heidermassu
Copy link

Were used the project CLI to create new "project" and faced with some problems:

1- Build image ../k8s-kurated-addons-cli/bin/kka-cli build
ISSUE I've tried build as default but is catching the neaform as standard, due to that had to pass the parameter ../k8s-kurated-addons-cli/bin/kka-cli --app-version v1.0 --repo-name ghcr.io/heidermassu/heidermassu/js-app-01 build
- During this command is generated the image localy might been seen using docker images command

2- push image
ISSUE when try to push the img got error saying the image do not exist due to beem looking for neaform repository (ghcr.io/nearform) then I change the global parameter ../k8s-kurated-addons-cli/bin/kka-cli --app-version v1.0 --repo-name ghcr.io/heidermassu/js-app-01 push --registry-user --registry-password
- changed the visibility to public
ISSUE ran the docker inspect ghcr.io/heidermassu/js-app-01/js-app-01:v1.0 and noticed the image were generated wrong for example the instrution CMD is as CMD ["index.js"] instead grab the informations from my code in this case did not catch right name of mine js server.js also did not see the Dockerfile created any place even though were possible do docker push then I ran the command ../k8s-kurated-addons-cli/bin/kka-cli template to see how were generated before and ../k8s-kurated-addons-cli/bin/kka-cli --app-version v1.1 --repo-name ghcr.io/heidermassu/heidermassu/js-app-01 --dockerfile-name Dockerfile build to genrate the image based on right Dockerfile instructions changing the CMD ["index.js"] to CMD ["server.js"]
- During the push is created a tag based in the build done by the command build
- attention - I had to connect into github (docker login ghcr.io -u)

3- init git
ISSUE Noticed that the github yaml is catching the the container repository from Neaform as Standard.
ISSUE I've tried to run GLOBAL OPTIONS ../k8s-kurated-addons-cli/bin/kka-cli --repo-name ghcr.io/heidermassu/js-app-01 init github but have not worked due to that I have to update yaml file manually with my own github

4- commit the code on repository
- git add .
- git commit
- git push
- At this moment were created the github actions
ISSUE during the image build got this error ghcr.io/heidermassu/heidermassu/js-app-01/js-app-01:v1.1 /usr/bin/docker create --name 63cfcb1bdda546ba82fb9e2a8c0e9e05_ghcrioheidermassuheidermassujsapp01jsapp01v11_27b9a0 --label ed866e --workdir /__w/js-app-01/js-app-01 --network github_network_e4baea5c27a64ef8b60a0143439bb53b -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/runners/2.304.0/externals":"/__e":ro -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" ghcr.io/heidermassu/heidermassu/js-app-01/js-app-01:v1.1 "-f" "/dev/null" e5d0aa4492094f011ad53beb77b07037e329e449d9310977050baa389efd6e8a /usr/bin/docker start e5d0aa4492094f011ad53beb77b07037e329e449d9310977050baa389efd6e8a Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "tail": executable file not found in $PATH: unknown Error: failed to start containers: e5d0aa4492094f011ad53beb77b07037e329e449d9310977050baa389efd6e8a Error: Docker start fail with exit code 1
- actions/runner#2481
I ran a test building and pushing manualy the image into Docker hub but did not work as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants