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

[bitnami/discourse] Plugins should be installed on sideqik as well #29169

Open
Giiltham opened this issue Sep 3, 2024 · 8 comments
Open

[bitnami/discourse] Plugins should be installed on sideqik as well #29169

Giiltham opened this issue Sep 3, 2024 · 8 comments
Assignees
Labels
discourse in-progress tech-issues The user has a technical issue about an application

Comments

@Giiltham
Copy link

Giiltham commented Sep 3, 2024

Name and Version

bitnami/discourse 14.1.0

What architecture are you using?

None

What steps will reproduce the bug?

install discourse-ai :

discourse: 
    plugins: 
        - https://github.com/discourse/discourse-ai
    persistPlugins: false

What is the expected behavior?

I should be able to use the discourse-ai plugin on my instance

What do you see instead?

plugins actions behind a Job don't work

In the logs, I see:

Job exception: uninitialized constant Jobs::GenerateEmbeddings
Job exception: uninitialized constant Jobs::CreateAiChatReply

Sideqik can't find the plugin Jobs, it doesn't have the plugin at all

Additional information

Installing manually the plugin by exec in the sidekiq container works.

persistPlugins : false should be the culprit here as it removes the link with the discourse-data volume, meaning it will prevent all plugins with jobs from working.

@Giiltham Giiltham added the tech-issues The user has a technical issue about an application label Sep 3, 2024
@github-actions github-actions bot added the triage Triage is needed label Sep 3, 2024
@github-actions github-actions bot removed the triage Triage is needed label Sep 4, 2024
@github-actions github-actions bot assigned juan131 and unassigned carrodher Sep 4, 2024
@juan131
Copy link
Contributor

juan131 commented Sep 4, 2024

Hi @Giiltham

Correct me if I'm wrong but you're able to reproduce the issue regardless the discourse.persistPlugins parameter is enabled or not, am I right?

@Giiltham
Copy link
Author

Giiltham commented Sep 4, 2024

I don't think i have this issue while using persistPlugins: true, as the plugins are also present on the Sideqik sidecar.
Using discourse-topic-voting with persistPlugins: false, I had over 1000:

Job exception: uninitialized constant Jobs::DiscourseTopicVoting

I don't have any since switching to persistPlugins: true (doesn't seems to be a valid option for us as it does not allow to add new plugins after initial setup)

@juan131
Copy link
Contributor

juan131 commented Sep 6, 2024

Hi @Giiltham

I see.. I can think of two different solutions:

  • Replicate logic to install plugins on Sidekiq sidecar when plugins aren't persisted.
  • Move plugins installation to a init-container that shares the modified filesystem with both Discourse and Sidekiq containers.

@AMontagu
Copy link

Hello @juan131

It look like the second recommandations: "Move plugins installation to a init-container that shares the modified filesystem with both Discourse and Sidekiq containers." is what it should be done when using persistPlugins. It create a PVC named discourse-data that should be shared between all instances.

The fact is that in the discource container the plugin are installed in /opt/bitnami/plugins but the volumes in mount on /bitnami/plugins

Is a specific script that copy the plugins to the discource-data ? Why not installing plugins directly on the pvc ?

@juan131
Copy link
Contributor

juan131 commented Sep 17, 2024

Hi @AMontagu

Let me provide you some context.

Discourse is installed under the /opt/bitnami/discourse folder. In order to provide a way to upgrade Discourse by simply replacing the container with a new container image (this process is explained in the link below), the container logic moves during initialization certain sub-directories to the /bitnami/discourse folder (where we mount Persistent Volumes to persist data) and create symbolic links following the format "/opt/bitnami/discourse/SUB_DIR_A points to /bitnami/discourse/SUB_DIR_A".

As explained in the container's README.md (check the link below), the data to be persisted is based on the env. variable DISCOURSE_DATA_TO_PERSIST which, by default, includes the "plugins" directory.

You can find the container logic that performs these steps in the links below:

@AMontagu
Copy link

Hello @juan131

Thank you for the time you took to make this explanation. This is more clear about how it works. The fact that plugin installed in the PVC was disappearing after being installed make sense now.

In the case where persistPlugins: true why not removing plugins from DISCOURSE_DATA_TO_PERSIST and use the PVC directly to /opt/bitnami/discourse ?

If we go further why not having a persistDiscourseData options that replace the persist_app bash function by a PVC that is directly mounted to the correct path ?

By the way with your explanation we was able to juste copy back the pvc populated in our init container to /bitnami/discourse/plugins after discourse initialisation. It just seem a little bit hacky because it initialize everything and try to persist data only to be overrided at the en by a copy from the PVC. To notice that this copy also add initialisation time.

@juan131
Copy link
Contributor

juan131 commented Sep 19, 2024

In the case where persistPlugins: true why not removing plugins from DISCOURSE_DATA_TO_PERSIST and use the PVC directly to /opt/bitnami/discourse ?
If we go further why not having a persistDiscourseData options that replace the persist_app bash function by a PVC that is directly mounted to the correct path ?

Persisting the whole application would break upgradability by replacing the container image (e.g. I'm running Discourse with container image docker.io/bitnami/discourse:3.3.0-debian-12-r0 and I replace it with docker.io/bitnami/discourse:3.3.1-debian-12-r4) given the app code will be persisted.

@AMontagu
Copy link

I see for the whole application. But only for the plugins folder should work no ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discourse in-progress tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

4 participants