Skip to content

Commit

Permalink
Add ECR docker images to the downloads options
Browse files Browse the repository at this point in the history
* Introduces "inline instructions" for the versions
  * Employed it to display docker instructions from Docker Hub and Amazon ECR
  * Added "inline instructions" definition to the latest artifact files
* Introduces `rouge` for code highlighting
  * This is used to style code blocks used by the "inline instructions"
  * This is also used to fix the broken highlighting system of the website

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Jul 13, 2022
1 parent 20fcbe6 commit 05d7ebe
Show file tree
Hide file tree
Showing 13 changed files with 151 additions and 22 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

gem "rouge"
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ DEPENDENCIES
jekyll-redirect-from (~> 0.16)
jekyll-sitemap
minima (~> 2.5)
rouge
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.1)

BUNDLED WITH
2.2.22
2.3.5
12 changes: 11 additions & 1 deletion _artifacts/data-prepper/data-prepper-1.5.1-docker-x64.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ version: data-prepper-1.5.1
platform: docker
type: docker_hub
architecture: x64
link: https://hub.docker.com/r/opensearchproject/data-prepper/tags?page=1&ordering=last_updated&name=1.5.1
slug: data-prepper-1.5.1-docker-x64
category: opensearch
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/data-prepper:1.5.1
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/data-prepper/tags?page=1&ordering=last_updated&name=1.5.1
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/data-prepper:1.5.1
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/data-prepper
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ architecture: arm64
slug: logstash-oss-with-opensearch-output-plugin-7.16.3-docker-arm64
category: logstash-oss-with-opensearch-output-plugin
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin/tags?page=1&ordering=last_updated&name=7.16.3
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ architecture: x64
slug: logstash-oss-with-opensearch-output-plugin-7.16.3-docker-x64
category: logstash-oss-with-opensearch-output-plugin
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin/tags?page=1&ordering=last_updated&name=7.16.3
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.3
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/logstash-oss-with-opensearch-output-plugin
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ architecture: arm64
slug: opensearch-2.1.0-docker-arm64
category: opensearch
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/opensearch:2.1.0
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/opensearch:2.1.0
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/opensearch
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ architecture: arm64
slug: opensearch-dashboards-2.1.0-docker-arm64
category: opensearch-dashboards
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/opensearch-dashboards:2.1.0
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/opensearch-dashboards:2.1.0
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/opensearch-dashboards
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ architecture: x64
slug: opensearch-2.1.0-docker-x64
category: opensearch
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/opensearch:2.1.0
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/opensearch/tags?page=1&ordering=last_updated&name=2.1.0
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/opensearch:2.1.0
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/opensearch
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ architecture: x64
slug: opensearch-dashboards-2.1.0-docker-x64
category: opensearch-dashboards
type: docker_hub
link: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0
inline_instructions:
- label: "Docker Hub"
code: docker pull opensearchproject/opensearch-dashboards:2.1.0
link:
label: View on Docker Hub
url: https://hub.docker.com/r/opensearchproject/opensearch-dashboards/tags?page=1&ordering=last_updated&name=2.1.0
- label: "Amazon ECR"
code: docker pull public.ecr.aws/opensearchproject/opensearch-dashboards:2.1.0
link:
label: View on Amazon ECR
url: https://gallery.ecr.aws/opensearchproject/opensearch-dashboards
---
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ paginate_path: "/blog/page:num/"

timezone: "Etc/UTC"

highlighter: rouge

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
Expand Down
23 changes: 22 additions & 1 deletion _layouts/versions.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: default
notice: true
highlighter: rouge

pretty:
guide: "Install Guide"
Expand Down Expand Up @@ -216,6 +217,23 @@ <h3 class="artifact-name" id="{{component.artifact}}">{{ name_pretty }}</h3>
</div>{% endcapture %}
{% assign artifact_extras = artifact_extras | append: artifact_extra %}
{% endif %}
{% if details.inline_instructions %}
{% capture artifact_instructions %}
{{artifact_instructions}}
<div class="extra_instructions extra_{{artifact_id}}">
{% for instruction in details.inline_instructions %}
<h4 class="instruction-label">
{% if instruction.link %}
<a href="{{instruction.link.url}}" target="_blank">{{instruction.link.label}}</a>
{% endif %}
{{instruction.label}}
</h4>
{% highlight bash %}{{instruction.code}}{% endhighlight %}
{% endfor %}
</div>
{% endcapture %}
{% assign artifact_extras = artifact_extras | append: artifact_extra %}
{% endif %}
{% if details.guide %}
{% capture artifact_extra %}<div class="extra_links extra_{{artifact_id}}"> <a href="{{details.guide}}"> {{guide_pretty}} </a> </div>{% endcapture %}
{% assign artifact_extras = artifact_extras | append: artifact_extra %}
Expand All @@ -242,13 +260,16 @@ <h3 class="artifact-name" id="{{component.artifact}}">{{ name_pretty }}</h3>
{% endif %}
{% if artifact_option %}
<label for="package_select_{{artifact_id}}">Package:</label>
<select for="package_select_{{artifact_id}}" class="dl-artifact-select">{{ artifact_options }}</select>
<select id="package_select_{{artifact_id}}" class="dl-artifact-select">{{ artifact_options }}</select>
{% assign artifact_options = "" %}
{% endif %}
<div class="extra-links-group">{{artifact_extras}}</div>
{% assign artifact_extras = "" %}
</div>

<div class="extra-instructions-group">{{artifact_instructions}}</div>
{% assign artifact_instructions = "" %}

</div>
</div>

Expand Down
32 changes: 31 additions & 1 deletion _sass/_opensearch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,18 @@ dl.list-features {
}
.artifact-container {
display: flex;
flex-flow: row wrap;
gap: 1em;

.artifact-explain {
width : 66%;
flex-grow: 1;

>p:last-child {
margin-bottom: 0;
}
}
.download-panel {
margin-left: 1em;
flex-grow: 1;
@include sans-serif;

Expand All @@ -388,6 +393,31 @@ dl.list-features {
max-width: none;
}
}
.extra-instructions-group {
width: 100%;
flex-shrink: 0;

.highlight {
margin: 0 0 15px;
}
}

.instruction-label {
margin: 0 0 .2rem;

a {
@include sans-serif;
font-weight: 400;
font-size: 1.2rem;
float: right;
margin-top: .6rem;
line-height: 1;

&:visited {
color: inherit;
}
}
}
}

.artifact-standalone {
Expand Down
27 changes: 15 additions & 12 deletions assets/js/mod/select_logic.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
define([
'jquery' //requires jquery
], function( $ ) {
function selectExtras($extras,id) {
$extras.children().show();
$extras.children(':not(.extra_'+id+')').hide(); //$artifactSelect.val()
function selectExtras($root) {
var
$artifactSelect = $root,
$artifactSelectVal = $artifactSelect.val(),
$extraLinks = $artifactSelect.parent().find('.extra-links-group'),
$extraInstructions = $artifactSelect.parent().parent().children('.extra-instructions-group');

$extraLinks.children().show();
$extraLinks.children(':not(.extra_'+$artifactSelectVal+')').hide();

$extraInstructions.children('.extra_' + $artifactSelectVal).show();
$extraInstructions.children(':not(.extra_' + $artifactSelectVal + ')').hide();
}
function selectPlatform($root) {
var
var
$platformSelect = $root,
$artifactSelect = $platformSelect.parent().children('.dl-artifact-select'),
$extraLinks = $platformSelect.parent().children('.extra-links-group'),
firstItemVal;

$artifactSelect.children().show();
$artifactSelect.children(':not(.platform_'+$platformSelect.val()+')').hide();
firstItemVal = $artifactSelect.children('.platform_'+$platformSelect.val()).first().val();
$artifactSelect.val(firstItemVal);

$extraLinks.children().show();
$extraLinks.children(':not(.extra_'+$platformSelect.val()+')').hide();
selectExtras($extraLinks,firstItemVal);
selectExtras($artifactSelect);
}

$(".dl-platform-select").change(function() {
selectPlatform($(this));
});
$(".dl-artifact-select").change(function() {
var
$artifactSelect = $(this),
$extraLinks = $artifactSelect.parent().find('.extra-links-group');
selectExtras($extraLinks,$artifactSelect.val());
selectExtras($(this));
});

$(".dl-platform-select").each(function(){
Expand Down

0 comments on commit 05d7ebe

Please sign in to comment.