Skip to content

feat: add marimo-python chart#313

Open
PACordonnier wants to merge 2 commits into
InseeFrLab:mainfrom
adaltas:inseepr-light
Open

feat: add marimo-python chart#313
PACordonnier wants to merge 2 commits into
InseeFrLab:mainfrom
adaltas:inseepr-light

Conversation

@PACordonnier

Copy link
Copy Markdown

Description of the change

The PR aims to add Marimo as python env exclusively. It is a subset of PR #312.

I've made a more readable commit history. A commit having the change from vscode-python to marimo-python exists (67643b7) and is meant to highlight the changes made from vscode to marimo.

(Following text is copied from #312)

Changes:

  • in Chart.yaml
    • change name, description and other metadatas, set version to 0.0.1
  • README.md
    • delete its content, to be created by CI
  • values.schema.yaml
    • set the image name from inseefrlab/vscode-(xxx) to pacordonnier/marimo-(xxx)
  • values.yaml
    • set image version
    • set networking.service.port to 2718 (default marimo port)
  • templates folder:

Marimo does not support reading token/password from ENV, so needs to mount the secret-token as volumes

In statefulset.yaml, args are now:

{{- if .Values.git.asCodeServerRoot }}
args: ["{{ .Values.init.standardInitPath }} marimo edit --host 0.0.0.0 --token-password-file ~/.token/PASSWORD /home/{{ .Values.environment.user }}/work/$(basename $GIT_REPOSITORY) .git"]
{{- else }}
args: ["{{ .Values.init.standardInitPath }} marimo edit --host 0.0.0.0 --token-password-file ~/.token/PASSWORD /home/{{ .Values.environment.user }}/work"]
{{- end }}

volume for secret token needs to be declared in statefulset.yaml

spec.template.spec.volumes:
        - name: token
          secret:
            secretName: {{ include "library-chart.secretNameToken" . }}

volumeMounts:

spec.template.spec.containers[0].volumesMounts
- name: token  
  mountPath: /home/{{ .Values.environment.user }}/.token
   readOnly: true

Checklist

  • Chart version bumped in Chart.yaml
  • Title of the pull request follows this pattern [name_of_the_chart] Descriptive title

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's remove this for now. This should be adressed at a later time. (All I see so far is configuration for continue plugin extension which is vscode' specific)

secretName: {{ include "library-chart.secretNameCacerts" . }}
{{- end }}
{{- if (.Values.userPreferences.aiAssistant).enabled }}
- name: secret-assistant

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's remove this for now as we the assistant is not properly configured yet

echo 'initContainer make-secrets-writable is started';
{{ if (.Values.userPreferences.aiAssistant).enabled }}
mkdir /dest/continue
cp /src/continue/config.yaml /dest/continue/config.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It makes no sense to have continue configuration file here as it is specific to vscode

awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "/dest/cacerts/cert." c ".crt"}' < /tmp/ca.pem;
{{- end }}
volumeMounts:
{{- if (.Values.userPreferences.aiAssistant).enabled }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here, for now, let's remove anything related to aissistant (or the subject needs to be adressed properly : which file should be modified for the configuration to take effect ? are env. variables enough ? )

{{- end }}
resources:
limits:
cpu: 50m

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to be parameterized

image: "inseefrlab/onyxia-base:latest"
pullPolicy: IfNotPresent
image:
version: "pacordonnier/marimo-python:py3.13.12"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use inseefrlab images

userPreferences:
darkMode: false
language: "en"
aiAssistant:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should be removed for now

- name: ROOT_PROJECT_DIRECTORY
value: /home/{{ .Values.environment.user }}/work
{{- if .Values.userPreferences.darkMode }}
- name: DARK_MODE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it is configurable, we should make use of it when creating the image : https://github.com/InseeFrLab/images-datascience/blob/01d4fa974b3ca389a18b3e7ecb35632efebbfbaa/base/scripts/onyxia-init.sh#L152
Else, it should be removed

mountPath: /home/{{ .Values.environment.user }}/.token
readOnly: true
{{ if (.Values.userPreferences.aiAssistant).enabled }}
- mountPath: /home/{{ .Values.environment.user }}/.continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is specific to vscode and therefore should be removed

- https://github.com/InseeFrLab/images-datascience
- https://github.com/InseeFrLab/helm-charts-interactive-services
type: application
version: 0.0.4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we can start at version 1.0.0 or 0.1.0

@ihiverlet

Copy link
Copy Markdown
Contributor

Thank you for the PR @PACordonnier
Here are some requests for modifications. Would you like to take of them ?

@PACordonnier

Copy link
Copy Markdown
Author

thanks for the review, i will push the modification quickly

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