Skip to content

Commit

Permalink
Fix status update issue and redis port formatting issue (#16)
Browse files Browse the repository at this point in the history
* Fix status not updated issue

Subresource Status has been extracted to a separate API. use `client.Status().update()` instead

Signed-off-by: Jiaxin Shan <[email protected]>

* Fix int conversion issue by using strconv.Itoa(i)

Carelessly use string() to covert the int value and this gives ASCII value which makes redis port incorrect.

Signed-off-by: Jiaxin Shan <[email protected]>

* Fix inconsistent redis password in examples

Signed-off-by: Jiaxin Shan <[email protected]>
  • Loading branch information
Jeffwan authored Sep 5, 2021
1 parent e5002f8 commit 881b59a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bytedance/examples/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
object-manager-port: '12345'
node-manager-port: '12346'
object-store-memory: '100000000'
redis-password: 'LetMeInRay'
redis-password: 'AwesomeRay'
dashboard-host: '0.0.0.0'
num-cpus: '1'
node-ip-address: $MY_POD_IP
Expand Down
5 changes: 3 additions & 2 deletions bytedance/pkg/controllers/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"bytes"
"fmt"
"strconv"

rayiov1alpha1 "github.com/ray-project/ray-contrib/bytedance/pkg/api/v1alpha1"
"github.com/ray-project/ray-contrib/bytedance/pkg/controllers/common"
Expand Down Expand Up @@ -89,7 +90,7 @@ func SetContainerEnvs(container *corev1.Container, rayNodeType rayiov1alpha1.Ray
if !envVarExists(common.RayHeadServicePortEnv, container.Env) {
port := corev1.EnvVar{Name: common.RayHeadServicePortEnv}
if value, ok := params["port"]; !ok {
port.Value = string(common.DefaultRedisPort)
port.Value = strconv.Itoa(common.DefaultRedisPort)
} else {
port.Value = value
}
Expand Down Expand Up @@ -123,7 +124,7 @@ func AddServiceAddress(params map[string]string, nodeType rayiov1alpha1.RayNodeT
if _, ok := params["address"]; !ok {
var svcPort string
if _, ok := params["port"]; !ok {
svcPort = string(common.DefaultRedisPort)
svcPort = strconv.Itoa(common.DefaultRedisPort)
} else {
svcPort = params["port"]
}
Expand Down
2 changes: 1 addition & 1 deletion bytedance/pkg/controllers/v1alpha1/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (r *RayClusterReconciler) updateStatus(cluster *rayiov1alpha1.RayCluster) e
// TODO (@Jeffwan): Fetch head service and check if it's serving
// We always update cluster no matter if there's one change or not.
cluster.Status.LastUpdateTime.Time = time.Now()
if err := r.Update(context.TODO(), cluster); err != nil {
if err := r.Status().Update(context.TODO(), cluster); err != nil {
return err
}

Expand Down

0 comments on commit 881b59a

Please sign in to comment.