Recompile discourse without pulling new version


(mmmmmmmm) #1

We have a docker with discourse version 1.7.
We also have another app which access discourse via rest api.
Some of the api services (those regarding to groups) have changed from version 1. 7 to version 1.9 so if I rebuild discourse, the integration with the another app gets broken.
We need to change some parts of the discourse code without updating the version, while we adapt our code to the new rest api.
How can I do this?


(Jay Pfaffman) #2

Update the other app. You really need the security updates in the newer version.


(mmmmmmmm) #3

I have already updated the version, but in order to discourse to work in my app i need to make some modifications in the code. How can I assure that my code is being executed and not the latest pulled from discourse?


(Dean Taylor) #4

Write your modifications as a Discourse plugin, don’t modify the core Discourse code:

If there is something you don’t think the plugin will be able to do - start a new thread in the #dev category to discuss that - be specific about what you are trying to do and your reasons.


(mmmmmmmm) #5

Well, we want to include discourse as an iframe, (at our own risk ) This can’t be done with a plugin


(Jay Pfaffman) #6

Like @DeanMarkTaylor said, you want to make those changes in a plugin.

You’re on your own to figure that out, and if you do figure that out, you will no longer get any help here since you’ll be running your software and not Discourse.

If you want help figuring out how Git and Docker work, you might try Stack exchange.


(Thomas Abraham) #7

The recent release of discourse_docker (Update min docker version to last supported version · discourse/discourse_docker@ddf8c54 · GitHub) does not met my requirements. It is defining docker_min_version as 17.06.2 (previous commit was requiring 1.8.0)

I’m running Discourse on an ec2 instance with plain AmznLinux and don’t want to install system packages like docker from 3rd party repositories.
Hence I was running into the issue described in this thread.

Here’s my solution:
Roll back to previous commit:

git checkout 7c28a0615c29c26d6f115c7b3166a7597745db7f

Edit your container configuration, i.e. www.yml and change
from

params:
  version: stable

to

params:
  version: tags/v1.8.8

Rebuild your container and you should be fine.

P.S.
When entering this thread my browser send me straight to the last comment. Hence I missed the initial idea of not updating the code. If you don’t want to overwrite your changes you should put the logic into your own bootstrapping process.


(Stefano Maffulli) #8

You won’t be fine at all! you’ll be running an old, unmaintained version of the software. Since you’re on Amazon, a much better solution is to build a new instance, install latest Discourse stable, restore a backup from the old running server and once it’s done, switch the floating IP from the old server to the new one. This way you have a brand new server, and you keep on running software that is maintained.


(Thomas Abraham) #9

yes, I know - I’m running an old version. But if there is a hardcoded dependency to a not available docker version I have to go this approach. A new instance does not provide a new repository. AWS amznLinux still is at docker-17.03.2ce-1.59.amzn1.x86_64. Enterprises are different from communities. They do not trust community editions of Linux, like Ubuntu. Amazon Linux is a good compromise between Enterprise editions like RHEL and community editions.
Therefore it is much appreciated to not hardcode dependencies which do not have their technical reasons.


(Stefano Maffulli) #10

You write […] Enterprise […] require […] I read the Equifax excuse :slight_smile:

Anyway, Discourse tag/v1.8.8 is the latest release in the stable branch afaik so it’s still maintained. I’d pin to "stable" instead. Not sure what will happen when Discourse 1.9.x is released so you better get your systems ready.

And yet you’re running Docker’s Community Edition? Anyway, Canonical supports Ubuntu on Amazon plus you can buy all sort of professional support from Canonical on Amazon.

Again, you’re making a choice here, don’t blame your choices on someone else. And from what you wrote, you’re choosing to use a Linux distribution that is shipping an unmaintained version of Docker CE.


(Thomas Abraham) #11

lol, equifax.
I’m just talking about making upgrades a bit less painful. Stepping from docker_min_version 1.8.0 to 17.X is hard enough.
And, yes, running CE. If I’d needed EE I would stick at enterprise OS, not using AWS, not Discourse, no Chrome, no Linux, whatever.

I’d appreciate if a stable branch would be stable on systems not older than 12 months but updated regularly.


(Sam Saffron) #12

Docker don’t even support CE for 12 months, only 6. You need EE for 12 months which is SUPER expensive.

Discourse docker exists to LIMIT the amount of support we need to deal with from our community of free installers. Running an old unsupported and potentially broken version of Docker is in direct conflict with this goal