Skip to content

Conversation

smacker
Copy link
Contributor

@smacker smacker commented Jan 24, 2018

Fixes: #8

TODO (need infra):

  • Move from quay.io to docker hub
  • Test on minikube
  • Test helm chart on cluster with ingress

@bzz
Copy link
Contributor

bzz commented Jan 26, 2018

AFAIK current setup is copied from https://github.com/src-d/landing/

\cc @rporres for next steps

@bzz bzz mentioned this pull request Jan 26, 2018
Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

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

I only performed a high-level review, and saw that the changes made are only:

  • removing not needed services: landingApi and slackin,
  • renaming landing by code-annotation
    what makes sense for code-annotation necessities.

I only spotted some inconsistencies regarding hostnames for staging, so in general LGTM

.drone.yml Outdated
tiller_ns: kube-system
wait: true
when:
event: [tag] No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

missing EOL

.drone.yml Outdated
build_stg:
image: golang:1.8-alpine3.6
environment:
- REACT_APP_SERVER_URL="//code-annotation.srcd.run"
Copy link
Contributor

Choose a reason for hiding this comment

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

expected url would be //code-annotation-staging.srcd.run
same pattern than for: talks-staging.srcd.run, blog-staging.srcd.run, and landing-staging.srcd.run
https://github.com/src-d/guide/blob/master/engineering/continuous-delivery.md

.drone.yml Outdated
release: code-annotation
prefix: STG
secrets: [ STG_API_SERVER, STG_KUBERNETES_TOKEN ]
values: ingress.globalStaticIpName=code-annotation-staging,ingress.hostname=code-annotation.srcd.run,image.tag=commit-${DRONE_COMMIT_SHA:0:7}
Copy link
Contributor

Choose a reason for hiding this comment

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

expected ingress.hostname would be expected url would be code-annotation-staging.srcd.run

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure if I change it, I'll change it everywhere

.drone.yml Outdated
group: docker
image: plugins/docker
registry: quay.io
repo: quay.io/srcd/code-annotation
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to DockerHub

.drone.yml Outdated

# deployment to production environment

build_prod:
Copy link
Contributor

Choose a reason for hiding this comment

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

remove production

Copy link

@rporres rporres left a comment

Choose a reason for hiding this comment

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

Looks good. A couple of details to be addressed.

ingress:
annotations:
kubernetes.io/ingress.class: gce
kubernetes.io/tls-acme: "true"
Copy link

Choose a reason for hiding this comment

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

There was no way for you to know this, but we're moving away from kube-lego to handle Let's Encrypt certificates as it has given us some grief in the past and it's no longer under development. We're using kube-cert-manager. See https://github.com/src-d/docs/tree/master/helm-charts/docs

pullPolicy: IfNotPresent
registry: docker.io/srcd
codeAnnotation:
name: code-annotation
Copy link

Choose a reason for hiding this comment

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

Are you planning to have multiple images for this in the future? If not, this is not necessary. It was done that way in landing as deployment is composed of multiple containers. The standard way of declaring this is using image.repository and image.tag, e.g. https://github.com/src-d/docs/blob/master/helm-charts/docs/values.yaml#L6-L7 and https://github.com/src-d/docs/blob/master/helm-charts/docs/templates/deployment.yaml#L20

@smacker
Copy link
Contributor Author

smacker commented Jan 31, 2018

Addressed. PR waits for published docker image and cluster with ingress.

@smacker
Copy link
Contributor Author

smacker commented Jan 31, 2018

@rporres I just updated PR. There are secrets are required now.

And you can take image here:
https://hub.docker.com/r/smacker/code-annotation/tags/

@rporres
Copy link

rporres commented Feb 1, 2018

We have a problem with those secrets due to ipedrazas/drone-helm#52. The only workaround is for the chart to be able to accept a secret already deployed in the cluster.

If you want to keep your chart flexible enough (which I think it is good) I would modify the chart to:

  • only create the secret if .Values.secrets.github_client and its friends are present (you can add a condition surrounding the whole secret definition in templates/secrets.yaml)
  • define a variable containing the name of the secret at the beginning of templates/deployment.yaml based on a condition that would test if an existing secret is given or secret values are provided. See this as an example on how to define variables in a chart

The above solution would only work if the existing secret structure is the same as the secret already present in the cluster, so that would also need be documented.

I'm sorry that you've hit that nasty drone-helm bug

@bzz
Copy link
Contributor

bzz commented Feb 7, 2018

It seems that requested changes were done to work it round, so from conversation IRL \w @smacker we are just waiting for @rporres have some spare cycles to help us finishing testing it - the last item from PR todo in description.

@rporres
Copy link

rporres commented Feb 7, 2018

Now that I'm back to work I will take a look into this

@rporres
Copy link

rporres commented Feb 7, 2018

ingress metadata is missing the line

stable.k8s.psg.io/kcm.class: {{ .Values.ingress.kcmClass }}

@rporres
Copy link

rporres commented Feb 7, 2018

https://code-annotation-staging.srcd.run/ and https://code-annotation-staging.srcd.run/ work with the ingress fix above. Since we cannot force redirections in GCE ingress, it would be nice that the application did it

@rporres
Copy link

rporres commented Feb 7, 2018

I still have to configure drone, so please do not merge it

@smacker
Copy link
Contributor Author

smacker commented Feb 7, 2018

kcm.class added. I also rebased and squshed commits.

@smacker smacker changed the title [WIP] Setup release process Setup release process Feb 7, 2018
Copy link

@rporres rporres left a comment

Choose a reason for hiding this comment

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

Drone set up. Feel free to merge it.

Copy link
Contributor

@bzz bzz left a comment

Choose a reason for hiding this comment

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

🎉 nice!
Looks great to me.

@bzz bzz merged commit ade3f2c into src-d:master Feb 9, 2018
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

Successfully merging this pull request may close these issues.

4 participants