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

feat: add application image for snapshots #83

Conversation

omidasadpour
Copy link
Contributor

No description provided.

@omidasadpour omidasadpour self-assigned this Feb 7, 2024
@omidasadpour omidasadpour marked this pull request as draft February 7, 2024 11:07
@omidasadpour omidasadpour marked this pull request as ready for review February 7, 2024 12:35
@omidasadpour omidasadpour force-pushed the feat/application-image-for-snapshots branch from df0522c to a2b22fd Compare February 7, 2024 12:35
charts/rollups-node/values.yaml.tpl Show resolved Hide resolved
@@ -22,7 +26,7 @@ validator:
CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK: "true"
CARTESI_SNAPSHOT_DIR: "/usr/share/cartesi/snapshot"
initContainers:
- image: "docker.io/cartesi/dapp:echo-python-0.16.0-server"
- image: "{{ .Values.validator.application.image.repository }}:{{ .Values.validator.application.image.tag }}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@omidasadpour omidasadpour Feb 8, 2024

Choose a reason for hiding this comment

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

so we could use {{ include "application.image" . }} at the end

the include function should typically be used within template files rather than directly within the YAML structure of values.yaml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, we can use this approach to make it simpler :

validator:
  application:
    image: cartesi/dapp:echo-python-0.16.0-server

And then fetch the value:

validator:
  initContainers:
    - image: "{{ .Values.validator.application.image }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OR we can remove the - image section from initcontainer of values.yaml to the deployment template.
I'll send a fixup for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@omidasadpour omidasadpour force-pushed the feat/application-image-for-snapshots branch from 0ddace3 to 4341e53 Compare February 8, 2024 05:34
@@ -33,6 +33,7 @@ spec:
initContainers:
{{- if .Values.validator.initContainers }}
{{- include "tplvalues.render" ( dict "value" .Values.validator.initContainers "context" $ ) | nindent 8 }}
image: {{ include "application.image" . }}
Copy link
Collaborator

@endersonmaia endersonmaia Feb 8, 2024

Choose a reason for hiding this comment

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

How is this gonna work?

initContainers is a list, we don't know how many initContainer the user is gonna define.

For ex. we may have an initContainer for the snapshot and another to create the database.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, we can define if else.
if the name was snapshot then add this image.
What do U think ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't force a naming, the user could provide a snapshot any other way without even using an initContainer, for ex.

The approach in this #83 (comment) is the easy path for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's ready then ...

@omidasadpour omidasadpour force-pushed the feat/application-image-for-snapshots branch 2 times, most recently from 90946dc to 973f4bd Compare February 8, 2024 08:17
@@ -8,7 +8,7 @@ global:
# -- Global Docker image registry
registry: docker.io
# -- Global Docker Image tag
tag: 1.3.0
tag: 1.3.0-rc.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in a DELETE commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no 1.3.0 docker version anymore:

docker pull docker.io/cartesi/rollups-node:1.3.0

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no 1.3.0 yet. That's why we keep using a 1.3.0-rc.1 ina DELETE: commit so the CI passes, until we have a final 1.3.0 release an then we remove this commit and move on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, I did not know :)

@@ -2,7 +2,7 @@

# Package for Cartesi Rollups Nodes

![Version: 1.3.0-0](https://img.shields.io/badge/Version-1.3.0--0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 1.3.0-rc.1](https://img.shields.io/badge/Version-1.3.0--rc.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in the DELETE commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will show the current PR action status. So, In My Idea, Every PR should have it's own README based on the charts and versions. So, when we merge this PR, we should regenerate the README based on final PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

This picture is related to README of this PR.

| extraDeploy | list | `[]` | Array of extra objects to deploy with the release |
| fullnameOverride | string | `""` | String to fully override name |
| global.image.registry | string | `"docker.io"` | Global Docker image registry |
| global.image.tag | string | `"1.3.0"` | Global Docker Image tag |
| global.image.tag | string | `"1.3.0-rc.1"` | Global Docker Image tag |
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in the DELETE commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no 1.3.0 docker version anymore:

docker pull docker.io/cartesi/rollups-node:1.3.0

image

@omidasadpour omidasadpour force-pushed the feat/application-image-for-snapshots branch from 1b38734 to f98c749 Compare February 8, 2024 09:44
@omidasadpour omidasadpour merged commit 14ed708 into feature/adapt-to-rollups-node-1.3.0 Feb 8, 2024
4 checks passed
@omidasadpour omidasadpour deleted the feat/application-image-for-snapshots branch February 8, 2024 09:49
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.

2 participants