python:moinmoin

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:moinmoin [2019/08/13 00:24] – [空の Wiki を作成] ともやんpython:moinmoin [2021/07/05 02:40] (現在) ともやん
行 1: 行 1:
-<ifauth !@loggedinusers><html> 
-<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> 
-<script> 
-     (adsbygoogle = window.adsbygoogle || []).push({ 
-          google_ad_client: "ca-pub-0791334967460971", 
-          enable_page_level_ads: true 
-     }); 
-</script></html></ifauth> 
-<html> 
-  <style> 
-    #result pre { 
-      height: 200px; 
-      overflow: scroll; 
-      overflow-x: hidden; 
-    } 
-  </style> 
-</html> 
 ====== MoinMoin ====== ====== MoinMoin ======
-{{:python:moinmoin_logo.png?100|MoinMoin Logo}}\\+{{python:moinmoin_logo.png?100|MoinMoin Logo}}\\
 \\ \\
 本家: [[https://moinmo.in/|MoinMoinWiki - MoinMoin]]\\ 本家: [[https://moinmo.in/|MoinMoinWiki - MoinMoin]]\\
行 33: 行 16:
 [[https://github.com/moinwiki/moin|GitHub - moinwiki/moin: MoinMoin Wiki Development (2.0+)]] より、ソースコードをダウンロードする。\\ [[https://github.com/moinwiki/moin|GitHub - moinwiki/moin: MoinMoin Wiki Development (2.0+)]] より、ソースコードをダウンロードする。\\
 <code> <code>
-git clone https://github.com/moinwiki/moin.git+git clone --depth 1 https://github.com/moinwiki/moin.git
 </code> </code>
  
 ==== quickinstall.py を venv を利用するようにハックする ==== ==== quickinstall.py を venv を利用するようにハックする ====
 GitHub からダウンロードした **quickinstall.py** をリネームする。\\ GitHub からダウンロードした **quickinstall.py** をリネームする。\\
 +
 **Linux**\\ **Linux**\\
 +<WRAP prewrap 100%>
 <code> <code>
 $ cd moin $ cd moin
 $ mv quickinstall.py quickinstall.py.org $ mv quickinstall.py quickinstall.py.org
 </code> </code>
 +</WRAP>
 +
 **Windows**\\ **Windows**\\
 +<WRAP prewrap 100%>
 <code> <code>
 > cd moin > cd moin
 > ren quickinstall.py quickinstall.py.org > ren quickinstall.py quickinstall.py.org
 </code> </code>
 +</WRAP>
 +
 以下の **quickinstall.py** を **moin** ディレクトリにダウンロードする。(**quickinstall.py** を差し替える)\\ 以下の **quickinstall.py** を **moin** ディレクトリにダウンロードする。(**quickinstall.py** を差し替える)\\
 +<WRAP prewrap 100%>
 <code> <code>
 $ curl -O https://www.tomoyan.net/_media/python/quickinstall.py $ curl -O https://www.tomoyan.net/_media/python/quickinstall.py
 $ chmod 775 quickinstall.py $ chmod 775 quickinstall.py
 </code> </code>
-<WRAP prewrap 100% #result>+</WRAP> 
 +<WRAP prewrap 100% mincode_long>
 <file python moin/quickinstall.py> <file python moin/quickinstall.py>
 #!/usr/bin/python #!/usr/bin/python
行 110: 行 102:
 import fnmatch import fnmatch
 from collections import Counter from collections import Counter
-#try: +try: 
-   import virtualenv +    import virtualenv 
-#except ImportError: +except ImportError: 
-   sys.exit(""" +    sys.exit(""" 
-#Error: import virtualenv failed, either virtualenv is not installed (see installation docs) +Error: import virtualenv failed, either virtualenv is not installed (see installation docs) 
-#or the virtual environment must be deactivated before rerunning quickinstall.py +or the virtual environment must be deactivated before rerunning quickinstall.py 
-#""") +""")
-import venv+
  
 if sys.hexversion < 0x3050000: if sys.hexversion < 0x3050000:
行 470: 行 461:
         if wiki_exists():         if wiki_exists():
             command = '{0}moin index-create -i{1} moin index-build'.format(ACTIVATE, SEP)             command = '{0}moin index-create -i{1} moin index-build'.format(ACTIVATE, SEP)
-            print('Rebuilding indexes...(ignore log messages from rst parser)...')+            print('Rebuilding indexes...')
             try:             try:
                 subprocess.call(command, shell=True)                 subprocess.call(command, shell=True)
行 648: 行 639:
         base, source_name = os.path.split(source)         base, source_name = os.path.split(source)
         executable = os.path.basename(sys.executable).split('.exe')[0]         executable = os.path.basename(sys.executable).split('.exe')[0]
-        #venv = os.path.join(base, '{0}-venv-{1}'.format(source_name, executable)) +        venv = os.path.join(base, '{0}-venv-{1}'.format(source_name, executable)) 
-        #venv = os.path.abspath(venv) +        venv = os.path.abspath(venv) 
-        #venv_home, venv_lib, venv_inc, venv_bin = virtualenv.path_locations(venv+        venv_home, venv_lib, venv_inc, venv_bin = virtualenv.path_locations(venv)
-        venv_home = os.path.join(base, '{0}-venv-{1}'.format(source_name, executable)) +
-        venv_home = os.path.abspath(venv_home) +
-        self.builder = venv.EnvBuilder(with_pip=True) +
-        context = self.builder.ensure_directories(venv_home) +
-        venv_home, venv_lib, venv_inc, venv_bin = ( +
-            context.env_dir, +
-            os.path.join(context.env_dir, 'Lib') if sys.platform == 'win32' else os.path.join(context.env_dir, 'lib'), +
-            context.inc_path, +
-            context.bin_path)+
         self.dir_venv = venv_home         self.dir_venv = venv_home
         self.dir_venv_bin = venv_bin         self.dir_venv_bin = venv_bin
行 671: 行 653:
  
     def do_venv(self):     def do_venv(self):
-        #virtualenv.create_environment(self.dir_venv) +        virtualenv.create_environment(self.dir_venv)
-        self.builder.create(self.dir_venv)+
  
     def get_pip_version(self):     def get_pip_version(self):
行 737: 行 718:
             choices.add(name)             choices.add(name)
     args = sys.argv[:]     args = sys.argv[:]
-    args[0] = os.path.basename(args[0]) 
  
     if len(args) > 2 and args[-1] == '--help':     if len(args) > 2 and args[-1] == '--help':
行 797: 行 777:
 ==== インストール ==== ==== インストール ====
 **quickinstall.py** を実行する。\\ **quickinstall.py** を実行する。\\
 +
 **Linux**\\ **Linux**\\
 +<WRAP prewrap 100%>
 <code> <code>
 $ python3 quickinstall.py $ python3 quickinstall.py
 </code> </code>
-<WRAP prewrap 100% #result>+</WRAP> 
 +<WRAP prewrap 100% result>
 <code> <code>
 Running quickinstall.py... output messages redirected to m-quickinstall.txt Running quickinstall.py... output messages redirected to m-quickinstall.txt
行 814: 行 797:
 </code> </code>
 </WRAP> </WRAP>
 +
 **Windows**\\ **Windows**\\
 +<WRAP prewrap 100%>
 <code> <code>
-python quickinstall.py+python3 quickinstall.py
 </code> </code>
-<WRAP prewrap 100% #result>+</WRAP> 
 +<WRAP prewrap 100% result>
 <code> <code>
 +Running quickinstall.py... output messages redirected to m-quickinstall.txt
 +
 Searching m-quickinstall.txt, important messages are shown below... Do "m log quickinstall" to see complete log. Searching m-quickinstall.txt, important messages are shown below... Do "m log quickinstall" to see complete log.
  
-83       Successfully uninstalled setuptools-40.8.0 +139 Successfully installed Babel-2.9.Flask-1.1.Flask-Babel-2.0.Flask-Caching-1.10.Flask-Script-2.0.6 Flask-Theme-0.3.Jinja2-2.11.Markdown-3.3.MarkupSafe-2.0.1 Werkzeug-1.0.XStatic-1.0.2 XStatic-AnyWikiDraw-0.14.2 XStatic-Bootstrap-3.1.1.2 XStatic-CKEditor-3.6.4.0 XStatic-Font-Awesome-4.7.0.0 XStatic-JQuery.TableSorter-2.14.5.XStatic-Pygments-2.9.0.1 XStatic-TWikiDraw-moin-2004.10.23.2 XStatic-autosize-1.17.2.1 XStatic-jQuery-3.5.1.1 XStatic-jQuery-File-Upload-10.31.0.1 XStatic-svg-edit-moin-2012.11.27.1 blinker-1.4 chardet-4.0.click-7.1.2 docutils-0.17.emeraldtree-0.10.0 feedgen-0.9.0 flatland-0.9.1 greenlet-1.1.0 itsdangerous-1.1.0 lxml-4.6.3 moin passlib-1.7.pdfminer3-2018.12.3.0 pycryptodome-3.10.pygments-2.9.0 python-dateutil-2.8.1 pytz-2021.1 six-1.16.0 sortedcontainers-2.4.0 sqlalchemy-1.4.17 whoosh-2.7.4 
-119 Successfully installed Babel-2.7.Flask-1.1.Flask-Babel-0.12.2 Flask-Caching-1.7.Flask-Script-2.0.6 Flask-Theme-0.3.Jinja2-2.10.Markdown-3.1.MarkupSafe-1.1.1 Werkzeug-0.15.5 XStatic-1.0.2 XStatic-AnyWikiDraw-0.14.2 XStatic-Bootstrap-3.1.1.2 XStatic-CKEditor-3.6.4.0 XStatic-Font-Awesome-4.7.0.0 XStatic-JQuery.TableSorter-2.14.5.XStatic-Pygments-2.2.0.1 XStatic-TWikiDraw-moin-2004.10.23.2 XStatic-autosize-1.17.2.1 XStatic-jQuery-3.3.1.1 XStatic-jQuery-File-Upload-4.4.XStatic-svg-edit-moin-2012.11.27.1 blinker-1.4 chardet-3.0.click-7.docutils-0.15.emeraldtree-0.10.0 flatland-0.9.1 itsdangerous-1.1.0 moin passlib-1.7.pdfminer3-2018.12.3.0 pycryptodome-3.8.pygments-2.4.2 pytz-2019.2 setuptools-41.0.1 six-1.12.0 sortedcontainers-2.1.0 whoosh-2.7.4 +143 c:\my_projects\moin\.eggs\setuptools_scm-6.0.1-py3.9.egg\setuptools_scm\git.py:88: UserWarning: "C:\My_Projects\moin" is shallow and may cause errors 
-131 Successfully created or updated venv at c:\My_Projects\moin-venv-python+144   warnings.warn(f'"{wd.path}" is shallow and may cause errors'
 +154 Successfully created or updated venv at C:\My_Projects\moin-venv-python 
 +Quickinstall run time (h:mm:ss) 0:02:47
  
-> > > Type "m" for menu < < <+> > > Type "activate" to activate venv, then "m" for menu < < <
 </code> </code>
 </WRAP> </WRAP>
行 839: 行 829:
  
 menu を実行する。\\ menu を実行する。\\
-**Linux**\\ +**Linux, PowerShell**\\ 
-<code>+<WRAP prewrap 100%> 
 +<code powershell>
 $ ./m $ ./m
 </code> </code>
-**Windows**\\+</WRAP> 
 + 
 +コマンドプロンプト\\
 <code> <code>
 > m > m
 </code> </code>
-<code>+</WRAP> 
 +<WRAP prewrap 100% result> 
 +<code powershell> 
 usage: "m <target>" where <target> is: usage: "m <target>" where <target> is:
  
行 853: 行 849:
 extras          install packages required for docs and moin development extras          install packages required for docs and moin development
 docs            create moin html documentation (requires extras) docs            create moin html documentation (requires extras)
-interwiki       refresh contrib/interwiki/intermap.txt (version control)+interwiki       refresh intermap.txt
 log <target>    view detailed log generated by <target>, omit to see list log <target>    view detailed log generated by <target>, omit to see list
  
行 866: 行 862:
 index           delete and rebuild indexes index           delete and rebuild indexes
  
-css             run Stylus and lessc to update theme CSS files+css             run lessc to update basic theme CSS files
 tests *         run tests, log output (-v -k my_test) tests *         run tests, log output (-v -k my_test)
 coding-std      correct scripts that taint the repository with trailing spaces.. coding-std      correct scripts that taint the repository with trailing spaces..
行 875: 行 871:
 del-rej         delete all files matching *.rej del-rej         delete all files matching *.rej
 del-wiki        create a backup, then delete all wiki data del-wiki        create a backup, then delete all wiki data
 +
 </code> </code>
  
 ==== 空の Wiki を作成 ==== ==== 空の Wiki を作成 ====
-**Linux**\\ +**Linux, PowerShell**\\ 
-<code>+<WRAP prewrap 100%> 
 +<code powershell>
 $ ./m new-wiki $ ./m new-wiki
 </code> </code>
-**Windows**\\+ 
 +コマンドプロンプト\\
 <code> <code>
 > m new-wiki > m new-wiki
 </code> </code>
-<code>+</WRAP> 
 + 
 +<WRAP prewrap 100% result> 
 +<code powershell>
 Creating a new empty wiki... Creating a new empty wiki...
 Output messages redirected to m-new-wiki.txt. Output messages redirected to m-new-wiki.txt.
 +Important messages from m-new-wiki.txt are shown below:
  
-Successnew wiki has been created.+Errorattempt to create wiki failed. Do "m log new-wiki" to see complete log.
 </code> </code>
 +</WRAP>
  
 ==== moin2 の実行 ==== ==== moin2 の実行 ====
行 902: 行 906:
 > m run > m run
 </code> </code>
-<WRAP prewrap 100% #result>+<WRAP prewrap 100% result>
 <code> <code>
 2019-08-09 18:54:51,020 INFO moin.log:150 using logging configuration read from built-in fallback in moin.log module! 2019-08-09 18:54:51,020 INFO moin.log:150 using logging configuration read from built-in fallback in moin.log module!
行 923: 行 927:
 [[http://localhost:8080]] にブラウザーでアクセスする。\\ [[http://localhost:8080]] にブラウザーでアクセスする。\\
 {{:python:moinmoin2.png?800|MoinMoin 2}}\\ {{:python:moinmoin2.png?800|MoinMoin 2}}\\
 +
 +===== ApacheBench してみる =====
 +ローカル簡易実行での ApacheBench の結果。\\
 +**Web Server:** Werkzeug/0.15.6\\
 +**Wiki App:** MoinMoin2\\
 +**Lang:** Python 3.7.4\\
 +**Web Interface:** WSGI\\
 +<WRAP prewrap 100% result>
 +<code>
 +> ab -n 1000 -c 100 http://localhost:8080/Home
 +This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
 +Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 +Licensed to The Apache Software Foundation, http://www.apache.org/
 +
 +Benchmarking localhost (be patient)
 +Completed 100 requests
 +Completed 200 requests
 +Completed 300 requests
 +Completed 400 requests
 +Completed 500 requests
 +Completed 600 requests
 +Completed 700 requests
 +Completed 800 requests
 +Completed 900 requests
 +Completed 1000 requests
 +Finished 1000 requests
 +
 +
 +Server Software:        Werkzeug/0.15.6
 +Server Hostname:        localhost
 +Server Port:            8080
 +
 +Document Path:          /Home
 +Document Length:        17256 bytes
 +
 +Concurrency Level:      100
 +Time taken for tests:   350.456 seconds
 +Complete requests:      1000
 +Failed requests:        527
 +   (Connect: 0, Receive: 0, Length: 527, Exceptions: 0)
 +Total transferred:      17410304 bytes
 +HTML transferred:       17125304 bytes
 +Requests per second:    2.85 [#/sec] (mean)
 +Time per request:       35045.644 [ms] (mean)
 +Time per request:       350.456 [ms] (mean, across all concurrent requests)
 +Transfer rate:          48.51 [Kbytes/sec] received
 +
 +Connection Times (ms)
 +              min  mean[+/-sd] median   max
 +Connect:        0    0   0.5      0       1
 +Processing:   357 34234 4558.1  35388   40767
 +Waiting:      300 34203 4557.3  35359   40723
 +Total:        357 34234 4558.1  35389   40767
 +
 +Percentage of the requests served within a certain time (ms)
 +  50%  35389
 +  66%  37042
 +  75%  37648
 +  80%  38042
 +  90%  38871
 +  95%  39403
 +  98%  39964
 +  99%  40189
 + 100%  40767 (longest request)
 +</code>
 +</WRAP>
 +
 +1 秒間に平均どれくらいのリクエストをさばけるか?\\
 +<code>
 +Requests per second:    2.85 [#/sec] (mean)
 +</code>
 +1リクエストの平均応答時間は?\\
 +<code>
 +Time per request:       350.456 [ms] (mean, across all concurrent requests)
 +</code>
 +
 +**Web Server:** Apache/2.4.25\\
 +**Wiki App:** DokuWiki Release 2018-04-22b "Greebo"\\
 +**Lang:** PHP 7.3.3\\
 +**Web Interface:** FastCGI\\
 +<WRAP prewrap 100% result>
 +<code>
 +abs -n 1000 -c 100 https://wiki.monsters-g.local:1443/start
 +This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
 +Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
 +Licensed to The Apache Software Foundation, http://www.apache.org/
 +
 +Benchmarking wiki.monsters-g.local (be patient)
 +Completed 100 requests
 +Completed 200 requests
 +Completed 300 requests
 +Completed 400 requests
 +Completed 500 requests
 +Completed 600 requests
 +Completed 700 requests
 +Completed 800 requests
 +Completed 900 requests
 +Completed 1000 requests
 +Finished 1000 requests
 +
 +
 +Server Software:        Apache/2.4.25
 +Server Hostname:        wiki.monsters-g.local
 +Server Port:            1443
 +SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256
 +Server Temp Key:        ECDH P-256 256 bits
 +TLS Server Name:        wiki.monsters-g.local
 +
 +Document Path:          /start
 +Document Length:        19763 bytes
 +
 +Concurrency Level:      100
 +Time taken for tests:   62.989 seconds
 +Complete requests:      1000
 +Failed requests:        0
 +Total transferred:      20331000 bytes
 +HTML transferred:       19763000 bytes
 +Requests per second:    15.88 [#/sec] (mean)
 +Time per request:       6298.879 [ms] (mean)
 +Time per request:       62.989 [ms] (mean, across all concurrent requests)
 +Transfer rate:          315.21 [Kbytes/sec] received
 +
 +Connection Times (ms)
 +              min  mean[+/-sd] median   max
 +Connect:        7 1872 602.1   2033    3737
 +Processing:   100 3565 7886.9    620   58699
 +Waiting:       99 3563 7887.1    619   58698
 +Total:        284 5437 7678.7   2713   58830
 +
 +Percentage of the requests served within a certain time (ms)
 +  50%   2713
 +  66%   3079
 +  75%   3954
 +  80%   5102
 +  90%  11795
 +  95%  23513
 +  98%  33594
 +  99%  40993
 + 100%  58830 (longest request)
 +</code>
 +</WRAP>
 +
 +<code>
 +Requests per second:    15.88 [#/sec] (mean)
 +Time per request:       62.989 [ms] (mean, across all concurrent requests)
 +</code>
 +
 +===== 参考文献 =====
 +[[https://moin-20.readthedocs.io/en/latest/|Introducing MoinMoin — MoinMoin 0.1.dev194+gfdb6906 documentation]]\\
  
  • python/moinmoin.1565623464.txt.gz
  • 最終更新: 2019/08/13 00:24
  • by ともやん