#123 coreos-download: add GCP info on cloud launchable tab
Merged 4 years ago by dustymabe. Opened 4 years ago by abai.
fedora-web/ abai/websites coreos-download-gcp  into  master

@@ -385,6 +385,9 @@ 

      isAws: function(platform) {

        return platform == "aws";

      },

+     isGcp: function(platform) {

+       return platform == "gcp";

+     },

      isVirtualizedImage: function(platform) {

        return virtualizedImages.includes(platform);

      },
@@ -449,6 +452,12 @@ 

            }

            Vue.set(this.streamDisplay.cloudLaunchable, platform, {list: displayEntries});

          }

+         else if (this.isGcp(platform)) {

+           const name = getMember(images[platform], "name");

+           const family = getMember(images[platform], "family");

+           const project = getMember(images[platform], "project");

+           Vue.set(this.streamDisplay.cloudLaunchable, platform, {platform: prettyPlatform, name, family, project});

+         }

          else {

            const image = getMember(images[platform], "image");

            Vue.set(this.streamDisplay.cloudLaunchable, platform, {platform: prettyPlatform, image: image});
@@ -637,6 +646,44 @@ 

                }));

              }

            }

+           if (coreos_download_app.isGcp(platform)) {

+             return h('div', { class: "p-2 m-2" }, [

+               displayInfo.platform ? h('div', { class: "font-weight-bold" }, displayInfo.platform) : null,

+               coreos_download_app.streamData.stream ? h('span', { class: "text-secondary" }, coreos_download_app.streamData.stream) : null,

+               displayInfo.project ? h('div', { class: "ml-2" }, [ "Project: ", displayInfo.project ]) : null,

+               displayInfo.family ? h('div', { class: "ml-2" }, [

+                 "Family: ",

+                 h('a', {

+                   attrs: {

+                     href: `https://console.cloud.google.com/marketplace/details/fedora-coreos-cloud/fedora-coreos-${coreos_download_app.streamData.stream}`

+                   }

+                 }, displayInfo.family),

+                 " (",

+                 h('a', {

+                   attrs: {

+                     href: "#"

+                   },

+                   on: {

+                     click: function(e) {

+                       e.preventDefault();

+                       let gcpNameElement = e.target.parentElement.nextSibling;

+                       gcpNameElement.hidden = !gcpNameElement.hidden;

+                     }

+                   }

+                 }, 'details'),

+                 ")"]

+               ) : null,

+               displayInfo.name ? h('div', { class: "ml-2", attrs: { hidden: true } }, [

+                 h('span', {}, [

+                   `- The current latest image in the`,

+                   h('span', { class: "font-weight-normal font-italic" }, ` ${displayInfo.family}`),

+                   " image family is ",

+                   h('span', { class: "font-weight-normal font-italic" }, displayInfo.name),

+                   "."

+                 ])

+               ]) : null

+             ]);

+           }

            else {

              return h('div', {}, [

                displayInfo.platform ? h('div', { class: "font-weight-bold" }, displayInfo.platform) : null,

Works along side with:
- https://github.com/coreos/fedora-coreos-releng-automation/pull/112 to add GCP info in release.json
- https://github.com/coreos/fedora-coreos-stream-generator/pull/11 to add GCP info in ${stream}.json

This change reads metadata from ${stream}.json and renders it. It is also possible to read directly from individual meta.json file but since the download page is already utilizing ${stream}.json, this changes is trying to make use of already fetched metadata instead of fetching another meta.json.

Closes: https://github.com/coreos/fedora-coreos-tracker/issues/494
Signed-off-by: Allen Bai abai@redhat.com

rebased onto 093937b772805c16e2e69b7fb99a404cc3372479

4 years ago

screenshot demo:
demo

Metadata Update from @bcotton:
- Request assigned

4 years ago

Metadata Update from @bcotton:
- Pull-request tagged with: content

4 years ago

cc @dustymabe @jlebon @bgilbert

As per the discussion in https://github.com/coreos/fedora-coreos-tracker/issues/494, do we want to hide the Name: fedora-coreos-31-20200517-3-0-gcp-x86-64 completely, and make it look like e.g.

GCP
    Family: fedora-coreos-stable  _stable_
    Project: fedora-coreos-cloud

?

@abai I'm not seeing GCP in the Cloud Launchable tab. Is your image a mockup or a screen shot of your local build?

@bcotton Yes, it's a local build served with local metadata json file. Sorry for confusion.

That looks good to me! Is there a GCP address we can make it a link to?

@jlebon The only link that is available in the meta.json is the GCS URL but discussions in the original issue lead to conclusion where we don't want to expose that URL

@abai Could this be placed at the top of another column and not at the end of the AWS list? I think people will miss it if it's on the bottom of the page.

@siosm :thumbsup: agreed, can I follow up with a separate PR for restyling the columns. This was discussed on https://github.com/coreos/fedora-coreos-tracker/issues/494#issuecomment-642023647 and I should be working on this shortly.

@abai Sure! Sorry I missed this comment in the tracker.

@jlebon The only link that is available in the meta.json is the GCS URL but discussions in the original issue lead to conclusion where we don't want to expose that URL

Oh yeah, definitely not a link to the blob. Though I was expecting there to be a link to GCP that takes you to the overall image family at least where one can then launch VMs. But anyway, not a blocker!

@jlebon The only link that is available in the meta.json is the GCS URL but discussions in the original issue lead to conclusion where we don't want to expose that URL

Oh yeah, definitely not a link to the blob. Though I was expecting there to be a link to GCP that takes you to the overall image family at least where one can then launch VMs. But anyway, not a blocker!

Let's link to the marketplace entry for each stream.

RIght now the testing and next stream pages don't exist, but they will shortly

Emm.. Not sure if this link is stable: https://console.cloud.google.com/marketplace/details/fedora-coreos-cloud/fedora-coreos-stable?project=our-vigil-261116&organizationId=54643501348

Is there a link to the image family specifically? Thanks for following up :)

cc @dustymabe @jlebon @bgilbert
As per the discussion in https://github.com/coreos/fedora-coreos-tracker/issues/494, do we want to hide the Name: fedora-coreos-31-20200517-3-0-gcp-x86-64 completely, and make it look like e.g.
GCP
Family: fedora-coreos-stable stable
Project: fedora-coreos-cloud

@abai - that would be nice. Could we do something like make it:

Project: fedora-coreos-cloud
Family: fedora-coreos-stable (details)

Where when you click on details it expands and mentions:
- The current latest image in the fedora-coreos-stable image family is fedora-coreos-32-20200601-3-0-gcp-x86-64.

rebased onto fc058e3e1deea8070b430656c5aa9a6f96f070dd

4 years ago

change demo

Updated with link to the GCP marketplace and the button for hiding image name.

perfect. assuming that The current latest image... text is only displayed when you click details then this LGTM.

Can you confirm?

@dustymabe Yes, it's hidden by default and only shown when details is clicked.

Also this PR is reading from ${stream}.json so it will take effect only after GCP info got into the ${stream}.json metadata. I kind of prefer merging the metadata PR before this just in case the metadata field needs some modification.

rebased onto daa8d1e

4 years ago

Pull-Request has been merged by dustymabe

4 years ago