This is an automated email from the ASF dual-hosted git repository.
jiwq pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git
The following commit(s) were added to refs/heads/master by this push:
new 4515abf SUBMARINE-702. Run new server docker image in helm upgrade
4515abf is described below
commit 4515abfcd14e595b586b7fdbec134644057cb1a2
Author: Byron <[email protected]>
AuthorDate: Tue Dec 29 23:49:24 2020 +0800
SUBMARINE-702. Run new server docker image in helm upgrade
### What is this PR for?
In backend development, after building a new server image, we need to
re-install the whole helm chart. However, installing the chart again is very
inefficient. In fact, we only need to apply new docker image in server pod, and
we can achieve so by calling helm upgrade.
However, we use the same image name (apache/submarine:server-0.5.0) in each
round of docker image building, and `helm upgrade` will not detect the change
in image.
Therefore, I add an unique identifier (timestamp) in
`submarine-server.yaml` file. Every time we call `helm upgrade`,
`submarine-server.yaml` will be different, so it will run the new server image.
```yaml
# submarine-server.yaml
...
template:
metadata:
labels:
run: "{{ .Values.submarine.server.name }}"
annotations:
timestamp: {{ now | quote }} # this line
...
# after parsing, it looks like:
metadata:
annotations:
timestamp: 2020-12-29 20:54:20.74787 +0800 CST m=+0.907604406
```
By doing so, we can make the backend development faster. We only need to
call `helm upgrade submarine` after producing a new server image rather than
re-installing the whole chart.
### What type of PR is it?
[Improvement]
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-702
### How should this be tested?
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? Yes
Author: Byron <[email protected]>
Closes #485 from ByronHsu/SUBMARINE-702 and squashes the following commits:
e5adc4f [Byron] add unique identifier in server yaml
6e1342d [Byron] add unique identifier in server yaml
---
helm-charts/submarine/templates/submarine-server.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/helm-charts/submarine/templates/submarine-server.yaml
b/helm-charts/submarine/templates/submarine-server.yaml
index 03dada2..c6f4ec4 100644
--- a/helm-charts/submarine/templates/submarine-server.yaml
+++ b/helm-charts/submarine/templates/submarine-server.yaml
@@ -48,6 +48,8 @@ spec:
metadata:
labels:
run: "{{ .Values.submarine.server.name }}"
+ annotations:
+ timestamp: {{ now | quote }}
spec:
serviceAccountName: "{{ .Values.submarine.server.name }}"
containers:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]