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

[docker] add reporting fonts #74806

Merged
merged 11 commits into from
Oct 6, 2020
Merged

[docker] add reporting fonts #74806

merged 11 commits into from
Oct 6, 2020

Conversation

jbudz
Copy link
Member

@jbudz jbudz commented Aug 11, 2020

This bakes the Noto-CJK font into our docker builds. License notice wise we already have this added from the reporting folder, but it's a bit of a hack to rely on that, but I also don't want to duplicate it. Not sure.

EUI uses "Inter" by default but there isn't a CJK package, so I went with the status quo. Open to changing it, open to adding more fonts. The curl as opposed to apt-get portion is intentional - there's a limited selection on package repositories, and there's slight naming differences in centos and ubuntu.

Doing the usual draft for docker builds -> test -> revert --all-platforms -> add review label (and reporting team once this is squared away)

Closes #70889

https://www.google.com/get/noto/ for the list - everything by the looks of it. It's 1.1gb.

Release note:
Docker images now include CJK fonts built in.

@jbudz jbudz changed the title Docker/fonts [docker] add reporting fonts Aug 11, 2020
@tylersmalley
Copy link
Contributor

We have a troubleshooting guide for reporting here: https://www.elastic.co/guide/en/kibana/current/reporting-troubleshooting.html#reporting-troubleshooting-system-dependencies

Should these dependencies be updated? I think we should settle on a set of dependencies we recommend in the docs and use in the container.

@elastic/kibana-reporting-services

@jbudz
Copy link
Member Author

jbudz commented Aug 13, 2020

@elasticmachine merge upstream

@jbudz jbudz marked this pull request as ready for review August 17, 2020 15:35
@jbudz jbudz requested a review from a team as a code owner August 17, 2020 15:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@tsullivan
Copy link
Member

Should these dependencies be updated? I think we should settle on a set of dependencies we recommend in the docs and use in the container.

Right now the Reporting docs for setup requirements have a list of font packages that are locale-specific. Those were added incrementally in response to various issues.

If Noto-CJK is one package that supports all the locales, then we should clean up the list of dependencies. There is one or two baseline packages needed, such as fontconfig.

Let's update the docs to remove the mention of specific locale fonts. For international text requirements, we must guide people to install Noto. That aligns the manual setup with the Docker setup.

@tylersmalley
Copy link
Contributor

@jbudz, apologies for the conflict - but when you rebase it will now be in a retry loop to handle some network issues for that request.

The ~20M is not ideal here, but Chinese is a locale we directly support and we have a shortlist that needs specific fonts. In the future, we could revisit to see if this can be fetched at runtime mounted or something else.

Do we need to also provide the JA font?


RUN cd /usr/local/share/fonts/ \
&& curl-L -o "https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/NotoSansCJK-Regular.ttc" \
&& fc-cache -f -v
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is missing a \ for the newline here.

@jbudz
Copy link
Member Author

jbudz commented Aug 24, 2020

It'll support Chinese, Japanese and Korean. I'm going to see if this works with Red Hat's package repositories (the changes above), it is available under this name on CentOS. It looks like it may already be included but in the meantime trying to find a way to search without an active subscription. I'll spin up the docker image from this.

This is under a different name in the debian repository that I had alluded to before, but if we're not using that as a base I'm okay with it.

@tylersmalley
Copy link
Contributor

Random future idea, maybe we do something like linuxserver Docker Mods for additional fonts, etc.

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting a build failure:

 info [  kibana  ] Creating docker package
   │ info $ ./build_docker.sh
   │ info 8: Pulling from library/centos
   │ info Digest: sha256:76d24f3ba3317fa945743bb3746fbaf3a0b752f10b10376960de01da70685fbd
   │ info Status: Image is up to date for centos:8
   │ info docker.io/library/centos:8
   │ info Building: kibana-docker
   │ info Sending build context to Docker daemon  220.6MB
   │ info Step 1/28 : FROM centos:8 AS builder
   │ info  ---> 0d120b6ccaa8
   │ info Step 2/28 : COPY kibana-8.0.0-SNAPSHOT-linux-x86_64.tar.gz /opt
   │ info  ---> 12139965f527
   │ info Step 3/28 : RUN mkdir /usr/share/kibana
   │ info  ---> Running in 89f47a6b01c3
   │ info Removing intermediate container 89f47a6b01c3
   │ info  ---> 4e1a2405c998
   │ info Step 4/28 : WORKDIR /usr/share/kibana
   │ info  ---> Running in 6ecdb0d6c51a
   │ info Removing intermediate container 6ecdb0d6c51a
   │ info  ---> 9eff24b66638
   │ info Step 5/28 : RUN tar --strip-components=1 -zxf /opt/kibana-8.0.0-SNAPSHOT-linux-x86_64.tar.gz
   │ info  ---> Running in fcd5d2afff26
   │ info Removing intermediate container fcd5d2afff26
   │ info  ---> b35273eafdcd
   │ info Step 6/28 : RUN chmod -R g=u /usr/share/kibana
   │ info  ---> Running in 20e3b5d77ca6
   │ info Removing intermediate container 20e3b5d77ca6
   │ info  ---> 6892cab36ef9
   │ info Step 7/28 : RUN find /usr/share/kibana -type d -exec chmod g+s {} \;
   │ info  ---> Running in 0c297870781b
   │ info Removing intermediate container 0c297870781b
   │ info  ---> 965970a6dbbb
   │ info Step 8/28 : FROM centos:8
   │ info  ---> 0d120b6ccaa8
   │ info Step 9/28 : EXPOSE 5601
   │ info  ---> Using cache
   │ info  ---> ff279d0ea65f
   │ info Step 10/28 : RUN for iter in {1..10}; do       yum update --setopt=tsflags=nodocs -y &&       yum install --setopt=tsflags=nodocs -y         fontconfig freetype shadow-utils libnss3.so  &&       yum clean all && exit_code=0 && break || exit_code=$? && echo "yum error: retry $iter in 10s" &&       sleep 10;     done;     (exit $exit_code)
   │ info  ---> Using cache
   │ info  ---> af3889acedf2
   │ info Step 11/28 : RUN curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
   │ info  ---> Using cache
   │ info  ---> 7bc0a16d8ea7
   │ info Step 12/28 : RUN echo "37f2c1f0372a45554f1b89924fbb134fc24c3756efaedf11e07f599494e0eff9  /usr/local/bin/dumb-init" | sha256sum -c -
   │ info  ---> Using cache
   │ info  ---> 60f75ac423f8
   │ info Step 13/28 : RUN chmod +x /usr/local/bin/dumb-init
   │ info  ---> Using cache
   │ info  ---> 6ee6147ff744
   │ info Step 14/28 : RUN cd /usr/local/share/fonts/ && curl-L -o "https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/NotoSansCJK-Regular.ttc" && fc-cache -f -v && cd -
   │ info  ---> Running in df1dd9436541
   │ info /bin/sh: line 0: cd: /usr/local/share/fonts/: No such file or directory
   │ info The command '/bin/sh -c cd /usr/local/share/fonts/ && curl-L -o "https://github.com/googlefonts/noto-cjk/raw/NotoSansV2.001/NotoSansCJK-Regular.ttc" && fc-cache -f -v && cd -' returned a non-zero code: 1
   │ info
   │ERROR failure 4 min 59 sec

@jbudz
Copy link
Member Author

jbudz commented Oct 5, 2020

I'm running a build while I take a look for at the reporting docs. I went through the commands manually with a docker run on centos, need to verify ubi in particular

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jbudz
Copy link
Member Author

jbudz commented Oct 5, 2020

live notes while i test

docker network create foo
docker run -it --network="foo" --name=elasticsearch -e discovery.type="single-node" docker.elastic.co/elasticsearch/elasticsearch:master-SNAPSHOT-amd64
docker run -it --network="foo" --name=elasticsearch -e discovery.type="single-node" docker.elastic.co/elasticsearch/elasticsearch:master-SNAPSHOT-amd64
docker run --network=foo -e "ELASTICSEARCH_HOSTS=http://elasticsearch:9200" -e "ELASTICSEARCH_USERNAME=kibana_system" -e "ELASTICSEARCH_PASSWORD=changeme" -p 5601:5601 -it docker.elastic.co/kibana/kibana:8.0.0-SNAPSHOT
PUT /foo
POST /foo/_doc/c
{
  "bar": "阪載病写飾失密円画問前覧世界端。意平月価揮氏鋭一会暖県継健県演思鹿囲海推。終分図意野要行断士女酵定自定求。厳機具冷京示公産山弾争警。未極青遺月話愛上振乗育東法水。舞職決亡給照宣知康千氏経冬左位稿態属断。挑拙全能試作幻的面競鳥酒危政口職。同理因秀治掲周助稿決並雛治米点頑体低女語。格傷様真駐国供全安郷守覧部昨産期七権済"
}

POST /foo/_doc/j
{
  "bar": "61姿無ト改誠オタ与意断どんつ同役検ネチロユ州審チネヘ化注ゆあえで訪表へろゃべ新意別べラ国示ニ陸知ぽ際武エロ治男当がどそ。探マオワ残掲タ女応クル心化ハラア愛94真ご景81商タヨ株真タキ郵都ヘメセチ白常むほ弾有フだほ野画側て意万く玖同国沖めふ表藤ゆ張改ようま寄子生脱暮ずがごぼ。"
}


POST /foo/_doc/k
{
  "bar": "헌법재판소에서 법률의 위헌결정, 사면·감형 및 복권에 관한 사항은 법률로 정한다. 국회는 국무총리 또는 국무위원의 해임을 대통령에게 건의할 수 있다. 국회의원과 정부는 법률안을 제출할 수 있다."
}

https://s3-us-west-1.amazonaws.com/temp.jbudz.me/kibana-8.0.0-SNAPSHOT-docker-image.tar.gz
https://s3-us-west-1.amazonaws.com/temp.jbudz.me/kibana-ubi8-8.0.0-SNAPSHOT-docker-image.tar.gz

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tylersmalley
Copy link
Contributor

image

@tylersmalley
Copy link
Contributor

Remember to add a release note

@jbudz jbudz merged commit be11098 into elastic:master Oct 6, 2020
@jbudz jbudz deleted the docker/fonts branch October 6, 2020 00:08
jbudz added a commit that referenced this pull request Oct 6, 2020
@jbudz
Copy link
Member Author

jbudz commented Oct 6, 2020

7.x: 0c3a4ff

gmmorris added a commit to gmmorris/kibana that referenced this pull request Oct 6, 2020
* master: (85 commits)
  Refactor attribute service (elastic#78414)
  [APM] Add default message to alerts. (elastic#78930)
  [Discover] Modify columns and sort when switching index pattern (elastic#74336)
  Document ts project references setup (elastic#78586)
  build all ts refs in single kbn:bootstrap (elastic#79438)
  [TSVB] Allow string fields on value count aggregation (elastic#79267)
  [SECURITY SOLUTION] Investigate EQL signal in timeline (elastic#79049)
  [Fleet] Add loading spinner to page headers (elastic#79568)
  [Security Solution][Resolver] Resolver query panel load more (elastic#79160)
  Add type row to monitor detail page. (elastic#79556)
  Remove license refresh from setup (elastic#79518)
  [docker] add reporting fonts (elastic#74806)
  [SECURITY_SOLUTION][ENDPOINT] Add info about trusted apps to the page subtitle + create flyout (elastic#79558)
  Trim Hash value before validating it (elastic#79545)
  Warn users when security is not configured (elastic#78545)
  update copy styling (elastic#79313)
  Update dependency @elastic/charts to v23.1.1 (elastic#78459)
  Introduce geo-threshold alerts (elastic#76285)
  elastic#76920 Show base breadcrumb when there is an error booting the app (elastic#79571)
  remove react-intl from kibana and keep it inside only i18n package (elastic#78956)
  ...
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 74806 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 8, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 74806 or prevent reminders by adding the backport:skip label.

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 74806 or prevent reminders by adding the backport:skip label.

@tylersmalley tylersmalley added the backport:skip This commit does not require backporting label Oct 12, 2020
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 12, 2020
@kunisen
Copy link
Contributor

kunisen commented Feb 15, 2022

hi team,

previously we had this in manual,
https://www.elastic.co/guide/en/kibana/7.13/reporting-troubleshooting.html#reporting-troubleshooting-system-dependencies

image

but now it seems we don't say those fonts explicitly:
https://www.elastic.co/guide/en/kibana/7.17/reporting-troubleshooting.html#reporting-troubleshooting

I read this is because of this comment: #74806 (comment)


But one thing is not super clear to me, so please allow me to double check: 🙏

If Noto-CJK is one package that supports all the locales, then we should clean up the list of dependencies. 

Is it true that the Noto-CJK (this PR) is one package that supports all the locales?
Which means, we no longer need things like:

ipa-gothic-fonts
xorg-x11-fonts-100dpi
xorg-x11-fonts-75dpi
xorg-x11-utils
xorg-x11-fonts-cyrillic
xorg-x11-fonts-Type1
xorg-x11-fonts-misc
fontconfig
freetype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:Operations Team label for Operations Team v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Docker/Reporting] Stack Docker image doesn't provide enough language fonts for Reporting screen captures
6 participants