WordPress / meta-environment

A collection of scripts that provision the official WordPress.org websites into a Varying Vagrant Vagrants installation.
190 stars 69 forks source link

Create new site for Openverse #156

Closed dhruvkb closed 3 years ago

dhruvkb commented 3 years ago

This PR adds Openverse as a subsite under WordPress.org at /openverse.

Commit 48416d5 contains a redump of the same database using updated software (ref: #155), please exclude it when reviewing diffs.

iandunn commented 3 years ago

🤔 , are you thinking of adding Nginx configs, provision scripts, etc, or just the WP site in the DB?

The latter is fine, but I'm not sure if the Meta Env is a good approach for the former, see:

It looks like the OpenVerse repos currently use Docker, and I'm not sure there's a compelling reason to change that.

Although, maybe this could have some helpful provision scripts for stitching all the services together? And then folks could use those in any env?

How do all the OpenVerse devs currently setup their environments for working on all the different services? Is it basically just running through the individual setups, or is there extra stuff needed to get them working together?

tomjn commented 3 years ago

Very little of OpenVerse appears to be PHP, but rather python, and uses PostgreSQL, bringing it into VVV or even WP-Env is a much bigger task, the OV repos I can see so far don't use WordPress internally

Unless there are repositories I'm unaware of? I'm not an Automattician so any private repositories being prepared are out of my reach

dhruvkb commented 3 years ago

@iandunn and @tomjn Openverse will be deployed separately from WordPress.org using the openverse-* repos and a private Terraform repo under @Automattic. We use the Docker setups individually in the dev environments on our machine.

The production frontend is being iframe-d into WordPress.org with the help of a theme (WordPress/wordpress.org#31). As a result, this new site will not have any special NGINX config, nor will it need special provisioning of its own. It exists only to activate the new theme which has an iframe to embed the actual production site.

zackkrida commented 3 years ago

To build upon what @dhruvkb said, the Openverse API and front-end will live at *.openverse.engineering domains, so we can use our existing deployment pipeline with AWS and terraform.

The front-end search engine (which currently is live at https://search.creativecommons.org/, for example) will be iframe-ed into a WordPress theme at https://wordpress.org/openverse.

This iframing may be a temporary measure or long-term solution. We could likely add our front-end code directly to the WordPress theme long term. It's still not ideal to have an SPA embedded within a WordPress site, iframed or otherwise, but that's the plan for now!

iandunn commented 3 years ago

That all sounds good.

So if a dev wanted to contribute to OV, they'd setup those individual Docker containers, but if they wanted to contribute to the child theme they'd use the Meta Env?

zackkrida commented 3 years ago

That all sounds good.

So if a dev wanted to contribute to OV, they'd setup those individual Docker containers, but if they wanted to contribute to the child theme they'd use the Meta Env?

I'd expect the latter to be a rare occurrence, but yes exactly.

dd32 commented 3 years ago

Given the incredibly limited size and functionality of the https://github.com/WordPress/wordpress.org/pull/31 theme, I don't think this is suitable for the meta-environment.

The theme could be used as-is on any WordPress install, or, could have a .wp-env.json file added which AFAIK would just be the following:

{
   theme: [
      ".",
      "../wporg/"
   ]
}

and npm run wp-env start would boot a fully self-contained site to work in..

zackkrida commented 3 years ago

That seems quite reasonable @dd32

dhruvkb commented 3 years ago

Great point @dd32, adding the .wp-env.json file would do wonders for local setup! But since we're aiming to create the site for Openverse similar to how there is a theme directory and a plugins directory, shouldn't there be a meta-environment site for that built-in when setting up the wordpressorg.test environment?

dd32 commented 3 years ago

But since we're aiming to create the site for Openverse similar to how there is a theme directory and a plugins directory, shouldn't there be a meta-environment site for that built-in when setting up the wordpressorg.test environment?

I'd honestly be highly surprised if the Theme Directory and Plugin Directory in the meta environment actually work as expected. Pretty much everything has been moving to self-contained environments (WordCamp, Learn, Pattern Directory, Theme Directory, etc) which are not contained within this tooling.

If you want to use this environment for development of such an Openverse site, go for it, but there's a reason why it's not as actively used as it once was (pre-docker being a real thing era)

https://github.com/WordPress/pattern-directory, https://github.com/WordPress/learn (I'm not sure if the learn site included in this repo has kept up to date with that), https://github.com/WordPress/theme-directory-env, and https://github.com/WordPress/wordcamp.org/blob/production/.docker/readme.md are good examples of those more recent/modern options.

zackkrida commented 3 years ago

@dhruvkb have you considered the feedback here? I'm inclined to think we should close this and copy the approach of the pattern directory, but your call!

dhruvkb commented 3 years ago

Yes @zackkrida, in WordPress/wordpress.org@ebb01b3 I added the .wp-env settings to the Openverse theme (as suggested in https://github.com/WordPress/meta-environment/pull/156#issuecomment-847449551) so that it can be developed independently of the WordPress.org setup.

I was also inclined towards closing this and was waiting for your call 😆.