ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

hasura graphql-engine 源码构建问题

2022-07-04 23:02:17  阅读:241  来源: 互联网

标签:engine install hasura html haskell https ghc org 源码


基于centos 7 构建

安装haskell 构建工具

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

依赖包问题

  • gmp
yum install -y gmp-devel
  • pcre
yum install -y pcre-devel 
  • mysql

The program 'mysql_config' is required but it could not be found

yum install -y mariadb-devel
  • error "AES/PCLMUL instructions not enabled"

    禁用aesni

 
cabal build all --constraint="cryptonite -support_aesni"
  • pg

    注意版本问题,此方法可能会太低了

The program 'pg_config' is required but it could not be found

yum install -y postgresql-devel
  • Missing (or bad) C library: odbc
yum install -y unixODBC-devel
  • 可能需要的安装
yum  install -y libstdc++-devel libstdc++-static gcc-c++ ncurses-devel

构建

git clone https://github.com/hasura/graphql-engine.git
cd graphql-engine/server
cabal build all --constraint="cryptonite -support_aesni"

一些问题

适合内存不够用的场景,通过swap 解决,就是构建会比较慢,实际推荐使用一台配置比较好的机器构建(cpu,内存,以及磁盘)

dd if=/dev/zero of=/var/swapfile bs=1G count=10
mkswap /var/swapfile
swapon /var/swapfile
/etc/fstab
/var/swapfile swap swap defaults 0 0
 vim /etc/sysctl.conf
vm.swappiness = 60
sysctl -p

性能相关参数

默认没有开启profile 我们可以通过手工开启,方便性能优化
server/graphql-engine.cabal

 
flag profiling
  description: Configures the project to be profiling-compatible
  default: True
  manual: True

说明

以上是一个构建实践说明,推荐还是使用高版本的系统haskell 构建问题是不少,因为对于haskell 不是很了解,性能参数上边的还需要研究下

参考资料

https://gmplib.org/
https://www.haskell.org/ghcup/install/
https://github.com/hasura/graphql-engine
https://github.com/haskell-crypto/cryptonite
https://github.com/input-output-hk/cardano-node/issues/1747
https://www.haskell.org/ghcup/install/
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/config
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/profiling.html#prof-compiler-options
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/debug-info.html#implementor-s-notes-dwarf-annotations
https://github.com/fpco/ghc-prof-flamegraph
https://www.fpcomplete.com/blog/2015/04/ghc-prof-flamegraph/
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/profiling.html
https://www.tweag.io/blog/2020-01-30-haskell-profiling/
http://cnhaskell.com/chp/25.html

标签:engine,install,hasura,html,haskell,https,ghc,org,源码
来源: https://www.cnblogs.com/rongfengliang/p/16444758.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有