Prechádzať zdrojové kódy

:hammer: create morus & lily image build scripts

Jeremy Zheng 2 rokov pred
rodič
commit
2129390db8
37 zmenil súbory, kde vykonal 251 pridanie a 753 odobranie
  1. 46 0
      rpc/lily/Dockerfile
  2. 15 0
      rpc/lily/build.sh
  3. 0 0
      rpc/lily/lily/README.md
  4. 0 0
      rpc/lily/lily/__main__.py
  5. 0 0
      rpc/lily/lily/palm/__init__.py
  6. 0 0
      rpc/lily/lily/palm/excel.py
  7. 53 0
      rpc/lily/lily/palm/lily_pb2.py
  8. 79 24
      rpc/lily/lily/palm/lily_pb2_grpc.py
  9. 0 0
      rpc/lily/lily/palm/s3.py
  10. 0 0
      rpc/lily/lily/palm/svg.py
  11. 0 0
      rpc/lily/lily/palm/tex.py
  12. 0 0
      rpc/lily/lily/palm/word.py
  13. 0 0
      rpc/lily/lily/palm/worker.py
  14. 0 47
      rpc/lily/palm/lily_pb2.py
  15. 5 0
      rpc/lily/start.sh
  16. 3 2
      rpc/morus/Dockerfile
  17. 0 0
      rpc/morus/morus/.gitignore
  18. 0 0
      rpc/morus/morus/GPBMetadata/Morus.php
  19. 0 0
      rpc/morus/morus/Mint/Morus/V1/MarkdownClient.php
  20. 0 0
      rpc/morus/morus/Mint/Morus/V1/MarkdownToHtmlRequest.php
  21. 0 0
      rpc/morus/morus/Mint/Morus/V1/MarkdownToHtmlResponse.php
  22. 0 0
      rpc/morus/morus/client.php
  23. 0 0
      rpc/morus/morus/composer.json
  24. 0 0
      rpc/morus/morus/server.php
  25. BIN
      rpc/morus/src/GPBMetadata/Lily.php
  26. 0 31
      rpc/morus/src/Palm/Lily/V1/EpubBuildRequest.php
  27. 0 35
      rpc/morus/src/Palm/Lily/V1/EpubClient.php
  28. 0 49
      rpc/morus/src/Palm/Lily/V1/ExcelClient.php
  29. 0 58
      rpc/morus/src/Palm/Lily/V1/ExcelModel.php
  30. 0 88
      rpc/morus/src/Palm/Lily/V1/ExcelModel/Sheet.php
  31. 0 115
      rpc/morus/src/Palm/Lily/V1/ExcelModel/Sheet/Cell.php
  32. 0 95
      rpc/morus/src/Palm/Lily/V1/File.php
  33. 0 49
      rpc/morus/src/Palm/Lily/V1/TexClient.php
  34. 0 58
      rpc/morus/src/Palm/Lily/V1/TexToRequest.php
  35. 0 88
      rpc/morus/src/Palm/Lily/V1/TexToRequest/File.php
  36. 1 1
      rpc/morus/start.sh
  37. 49 13
      rpc/schema.sh

+ 46 - 0
rpc/lily/Dockerfile

@@ -0,0 +1,46 @@
+FROM ubuntu:latest
+LABEL maintainer="Jeremy Zheng"
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt update
+RUN apt -y upgrade
+RUN apt -y install build-essential \
+    imagemagick ffmpeg fonts-dejavu-extra texlive-full pandoc \
+    fonts-arphic-ukai fonts-arphic-uming \
+    fonts-noto-cjk fonts-noto-cjk-extra \
+    fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp fonts-arphic-gkai00mp \
+    fonts-wqy-microhei fonts-wqy-zenhei \
+    fonts-cns11643-kai fonts-cns11643-sung \
+    fonts-moe-standard-kai fonts-moe-standard-song \
+    fonts-ipafont-nonfree-jisx0208 \
+    python3-full python3-dev 
+
+# https://getcomposer.org/download/
+RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet --install-dir=/usr/local/bin --filename=composer
+
+RUN useradd -s /bin/bash -m deploy
+RUN passwd -l deploy
+RUN echo 'deploy ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/101-deploy
+RUN mkdir /opt/lily
+RUN chown deploy:deploy /opt/lily
+USER deploy
+
+# https://pip.pypa.io/en/stable/installation/
+RUN bash -c "python3 -m venv $HOME/python3 \
+    && . $HOME/python3/bin/activate \
+    && pip install --upgrade pip \
+    && pip install cmake \
+        psycopg minio redis[hiredis] \
+        pika msgpack matplotlib ebooklib \
+        grpcio protobuf grpcio-health-checking \
+        pandas openpyxl xlrd pyxlsb"
+RUN echo 'source $HOME/python3/bin/activate' >> $HOME/.bashrc
+
+COPY lily /opt/lily/
+
+RUN echo "$(date -u +%4Y%m%d%H%M%S)" | sudo tee /VERSION
+
+WORKDIR /opt/morus
+
+CMD ["/bin/bash"]

+ 15 - 0
rpc/lily/build.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+export VERSION=$(date "+%4Y%m%d%H%M%S")
+export CODE="mint-lily"
+
+buildah pull ubuntu:latest
+buildah bud --layers -t $CODE .
+podman save --format=oci-archive -o $CODE-$VERSION.tar $CODE
+md5sum $CODE-$VERSION.tar > md5.txt
+
+echo "done($CODE-$VERSION.tar)."
+
+exit 0

+ 0 - 0
rpc/lily/README.md → rpc/lily/lily/README.md


+ 0 - 0
rpc/lily/__main__.py → rpc/lily/lily/__main__.py


+ 0 - 0
rpc/lily/palm/__init__.py → rpc/lily/lily/palm/__init__.py


+ 0 - 0
rpc/lily/palm/excel.py → rpc/lily/lily/palm/excel.py


+ 53 - 0
rpc/lily/lily/palm/lily_pb2.py

@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: lily.proto
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import descriptor_pool as _descriptor_pool
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf.internal import builder as _builder
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
+
+
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nlily.proto\x12\x0cpalm.lily.v1\x1a\x1egoogle/protobuf/duration.proto\"\xb6\x01\n\nExcelModel\x12.\n\x06sheets\x18\x01 \x03(\x0b\x32\x1e.palm.lily.v1.ExcelModel.Sheet\x1ax\n\x05Sheet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x05\x63\x65lls\x18\x02 \x03(\x0b\x32#.palm.lily.v1.ExcelModel.Sheet.Cell\x1a-\n\x04\x43\x65ll\x12\x0b\n\x03row\x18\x01 \x01(\r\x12\x0b\n\x03\x63ol\x18\x02 \x01(\r\x12\x0b\n\x03val\x18\x03 \x01(\t\"<\n\x06S3File\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontent_type\x18\t \x01(\t\"X\n\x10S3GetFileRequest\x12\x0e\n\x06\x62ucket\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12&\n\x03ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\" \n\x11S3GetFileResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"\xe7\x01\n\x0cTexToRequest\x12\r\n\x05title\x18\x01 \x01(\t\x12\x34\n\x05\x66iles\x18\x02 \x03(\x0b\x32%.palm.lily.v1.TexToRequest.FilesEntry\x12+\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x88\x01\x01\x12\x12\n\x05owner\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x11\n\tpublished\x18\t \x01(\x08\x1a,\n\nFilesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\x42\x06\n\x04_ttlB\x08\n\x06_owner\"\x12\n\x10\x45pubBuildRequest2\x80\x01\n\x05\x45xcel\x12\x39\n\x05Parse\x12\x14.palm.lily.v1.S3File\x1a\x18.palm.lily.v1.ExcelModel\"\x00\x12<\n\x08Generate\x12\x18.palm.lily.v1.ExcelModel\x1a\x14.palm.lily.v1.S3File\"\x00\x32R\n\x02S3\x12L\n\x07GetFile\x12\x1e.palm.lily.v1.S3GetFileRequest\x1a\x1f.palm.lily.v1.S3GetFileResponse\"\x00\x32\x80\x01\n\x03Tex\x12;\n\x05ToPdf\x12\x1a.palm.lily.v1.TexToRequest\x1a\x14.palm.lily.v1.S3File\"\x00\x12<\n\x06ToWord\x12\x1a.palm.lily.v1.TexToRequest\x1a\x14.palm.lily.v1.S3File\"\x00\x32G\n\x04\x45pub\x12?\n\x05\x42uild\x12\x1e.palm.lily.v1.EpubBuildRequest\x1a\x14.palm.lily.v1.S3File\"\x00\x42.\n*com.github.saturn_xiv.palm.plugins.lily.v1P\x01\x62\x06proto3')
+
+_globals = globals()
+_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
+_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'lily_pb2', _globals)
+if _descriptor._USE_C_DESCRIPTORS == False:
+  DESCRIPTOR._options = None
+  DESCRIPTOR._serialized_options = b'\n*com.github.saturn_xiv.palm.plugins.lily.v1P\001'
+  _TEXTOREQUEST_FILESENTRY._options = None
+  _TEXTOREQUEST_FILESENTRY._serialized_options = b'8\001'
+  _globals['_EXCELMODEL']._serialized_start=61
+  _globals['_EXCELMODEL']._serialized_end=243
+  _globals['_EXCELMODEL_SHEET']._serialized_start=123
+  _globals['_EXCELMODEL_SHEET']._serialized_end=243
+  _globals['_EXCELMODEL_SHEET_CELL']._serialized_start=198
+  _globals['_EXCELMODEL_SHEET_CELL']._serialized_end=243
+  _globals['_S3FILE']._serialized_start=245
+  _globals['_S3FILE']._serialized_end=305
+  _globals['_S3GETFILEREQUEST']._serialized_start=307
+  _globals['_S3GETFILEREQUEST']._serialized_end=395
+  _globals['_S3GETFILERESPONSE']._serialized_start=397
+  _globals['_S3GETFILERESPONSE']._serialized_end=429
+  _globals['_TEXTOREQUEST']._serialized_start=432
+  _globals['_TEXTOREQUEST']._serialized_end=663
+  _globals['_TEXTOREQUEST_FILESENTRY']._serialized_start=601
+  _globals['_TEXTOREQUEST_FILESENTRY']._serialized_end=645
+  _globals['_EPUBBUILDREQUEST']._serialized_start=665
+  _globals['_EPUBBUILDREQUEST']._serialized_end=683
+  _globals['_EXCEL']._serialized_start=686
+  _globals['_EXCEL']._serialized_end=814
+  _globals['_S3']._serialized_start=816
+  _globals['_S3']._serialized_end=898
+  _globals['_TEX']._serialized_start=901
+  _globals['_TEX']._serialized_end=1029
+  _globals['_EPUB']._serialized_start=1031
+  _globals['_EPUB']._serialized_end=1102
+# @@protoc_insertion_point(module_scope)

+ 79 - 24
rpc/lily/palm/lily_pb2_grpc.py → rpc/lily/lily/palm/lily_pb2_grpc.py

@@ -18,13 +18,13 @@ class ExcelStub(object):
         """
         self.Parse = channel.unary_unary(
                 '/palm.lily.v1.Excel/Parse',
-                request_serializer=lily__pb2.File.SerializeToString,
+                request_serializer=lily__pb2.S3File.SerializeToString,
                 response_deserializer=lily__pb2.ExcelModel.FromString,
                 )
         self.Generate = channel.unary_unary(
                 '/palm.lily.v1.Excel/Generate',
                 request_serializer=lily__pb2.ExcelModel.SerializeToString,
-                response_deserializer=lily__pb2.File.FromString,
+                response_deserializer=lily__pb2.S3File.FromString,
                 )
 
 
@@ -50,13 +50,13 @@ def add_ExcelServicer_to_server(servicer, server):
     rpc_method_handlers = {
             'Parse': grpc.unary_unary_rpc_method_handler(
                     servicer.Parse,
-                    request_deserializer=lily__pb2.File.FromString,
+                    request_deserializer=lily__pb2.S3File.FromString,
                     response_serializer=lily__pb2.ExcelModel.SerializeToString,
             ),
             'Generate': grpc.unary_unary_rpc_method_handler(
                     servicer.Generate,
                     request_deserializer=lily__pb2.ExcelModel.FromString,
-                    response_serializer=lily__pb2.File.SerializeToString,
+                    response_serializer=lily__pb2.S3File.SerializeToString,
             ),
     }
     generic_handler = grpc.method_handlers_generic_handler(
@@ -82,7 +82,7 @@ class Excel(object):
             timeout=None,
             metadata=None):
         return grpc.experimental.unary_unary(request, target, '/palm.lily.v1.Excel/Parse',
-            lily__pb2.File.SerializeToString,
+            lily__pb2.S3File.SerializeToString,
             lily__pb2.ExcelModel.FromString,
             options, channel_credentials,
             insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@@ -100,15 +100,74 @@ class Excel(object):
             metadata=None):
         return grpc.experimental.unary_unary(request, target, '/palm.lily.v1.Excel/Generate',
             lily__pb2.ExcelModel.SerializeToString,
-            lily__pb2.File.FromString,
+            lily__pb2.S3File.FromString,
             options, channel_credentials,
             insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
 
 
-class TexStub(object):
-    """----------------------------------------------------------------------------
+class S3Stub(object):
+    """Missing associated documentation comment in .proto file."""
+
+    def __init__(self, channel):
+        """Constructor.
+
+        Args:
+            channel: A grpc.Channel.
+        """
+        self.GetFile = channel.unary_unary(
+                '/palm.lily.v1.S3/GetFile',
+                request_serializer=lily__pb2.S3GetFileRequest.SerializeToString,
+                response_deserializer=lily__pb2.S3GetFileResponse.FromString,
+                )
+
+
+class S3Servicer(object):
+    """Missing associated documentation comment in .proto file."""
+
+    def GetFile(self, request, context):
+        """Missing associated documentation comment in .proto file."""
+        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+        context.set_details('Method not implemented!')
+        raise NotImplementedError('Method not implemented!')
+
+
+def add_S3Servicer_to_server(servicer, server):
+    rpc_method_handlers = {
+            'GetFile': grpc.unary_unary_rpc_method_handler(
+                    servicer.GetFile,
+                    request_deserializer=lily__pb2.S3GetFileRequest.FromString,
+                    response_serializer=lily__pb2.S3GetFileResponse.SerializeToString,
+            ),
+    }
+    generic_handler = grpc.method_handlers_generic_handler(
+            'palm.lily.v1.S3', rpc_method_handlers)
+    server.add_generic_rpc_handlers((generic_handler,))
 
-    """
+
+ # This class is part of an EXPERIMENTAL API.
+class S3(object):
+    """Missing associated documentation comment in .proto file."""
+
+    @staticmethod
+    def GetFile(request,
+            target,
+            options=(),
+            channel_credentials=None,
+            call_credentials=None,
+            insecure=False,
+            compression=None,
+            wait_for_ready=None,
+            timeout=None,
+            metadata=None):
+        return grpc.experimental.unary_unary(request, target, '/palm.lily.v1.S3/GetFile',
+            lily__pb2.S3GetFileRequest.SerializeToString,
+            lily__pb2.S3GetFileResponse.FromString,
+            options, channel_credentials,
+            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
+
+class TexStub(object):
+    """Missing associated documentation comment in .proto file."""
 
     def __init__(self, channel):
         """Constructor.
@@ -119,19 +178,17 @@ class TexStub(object):
         self.ToPdf = channel.unary_unary(
                 '/palm.lily.v1.Tex/ToPdf',
                 request_serializer=lily__pb2.TexToRequest.SerializeToString,
-                response_deserializer=lily__pb2.File.FromString,
+                response_deserializer=lily__pb2.S3File.FromString,
                 )
         self.ToWord = channel.unary_unary(
                 '/palm.lily.v1.Tex/ToWord',
                 request_serializer=lily__pb2.TexToRequest.SerializeToString,
-                response_deserializer=lily__pb2.File.FromString,
+                response_deserializer=lily__pb2.S3File.FromString,
                 )
 
 
 class TexServicer(object):
-    """----------------------------------------------------------------------------
-
-    """
+    """Missing associated documentation comment in .proto file."""
 
     def ToPdf(self, request, context):
         """Missing associated documentation comment in .proto file."""
@@ -151,12 +208,12 @@ def add_TexServicer_to_server(servicer, server):
             'ToPdf': grpc.unary_unary_rpc_method_handler(
                     servicer.ToPdf,
                     request_deserializer=lily__pb2.TexToRequest.FromString,
-                    response_serializer=lily__pb2.File.SerializeToString,
+                    response_serializer=lily__pb2.S3File.SerializeToString,
             ),
             'ToWord': grpc.unary_unary_rpc_method_handler(
                     servicer.ToWord,
                     request_deserializer=lily__pb2.TexToRequest.FromString,
-                    response_serializer=lily__pb2.File.SerializeToString,
+                    response_serializer=lily__pb2.S3File.SerializeToString,
             ),
     }
     generic_handler = grpc.method_handlers_generic_handler(
@@ -166,9 +223,7 @@ def add_TexServicer_to_server(servicer, server):
 
  # This class is part of an EXPERIMENTAL API.
 class Tex(object):
-    """----------------------------------------------------------------------------
-
-    """
+    """Missing associated documentation comment in .proto file."""
 
     @staticmethod
     def ToPdf(request,
@@ -183,7 +238,7 @@ class Tex(object):
             metadata=None):
         return grpc.experimental.unary_unary(request, target, '/palm.lily.v1.Tex/ToPdf',
             lily__pb2.TexToRequest.SerializeToString,
-            lily__pb2.File.FromString,
+            lily__pb2.S3File.FromString,
             options, channel_credentials,
             insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
 
@@ -200,7 +255,7 @@ class Tex(object):
             metadata=None):
         return grpc.experimental.unary_unary(request, target, '/palm.lily.v1.Tex/ToWord',
             lily__pb2.TexToRequest.SerializeToString,
-            lily__pb2.File.FromString,
+            lily__pb2.S3File.FromString,
             options, channel_credentials,
             insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
 
@@ -219,7 +274,7 @@ class EpubStub(object):
         self.Build = channel.unary_unary(
                 '/palm.lily.v1.Epub/Build',
                 request_serializer=lily__pb2.EpubBuildRequest.SerializeToString,
-                response_deserializer=lily__pb2.File.FromString,
+                response_deserializer=lily__pb2.S3File.FromString,
                 )
 
 
@@ -240,7 +295,7 @@ def add_EpubServicer_to_server(servicer, server):
             'Build': grpc.unary_unary_rpc_method_handler(
                     servicer.Build,
                     request_deserializer=lily__pb2.EpubBuildRequest.FromString,
-                    response_serializer=lily__pb2.File.SerializeToString,
+                    response_serializer=lily__pb2.S3File.SerializeToString,
             ),
     }
     generic_handler = grpc.method_handlers_generic_handler(
@@ -267,6 +322,6 @@ class Epub(object):
             metadata=None):
         return grpc.experimental.unary_unary(request, target, '/palm.lily.v1.Epub/Build',
             lily__pb2.EpubBuildRequest.SerializeToString,
-            lily__pb2.File.FromString,
+            lily__pb2.S3File.FromString,
             options, channel_credentials,
             insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

+ 0 - 0
rpc/lily/palm/s3.py → rpc/lily/lily/palm/s3.py


+ 0 - 0
rpc/lily/palm/svg.py → rpc/lily/lily/palm/svg.py


+ 0 - 0
rpc/lily/palm/tex.py → rpc/lily/lily/palm/tex.py


+ 0 - 0
rpc/lily/palm/word.py → rpc/lily/lily/palm/word.py


+ 0 - 0
rpc/lily/palm/worker.py → rpc/lily/lily/palm/worker.py


+ 0 - 47
rpc/lily/palm/lily_pb2.py

@@ -1,47 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-"""Generated protocol buffer code."""
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import descriptor_pool as _descriptor_pool
-from google.protobuf import symbol_database as _symbol_database
-from google.protobuf.internal import builder as _builder
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nlily.proto\x12\x0cpalm.lily.v1\"C\n\x04\x46ile\x12\x19\n\x0c\x63ontent_type\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\x42\x0f\n\r_content_type\"\xb6\x01\n\nExcelModel\x12.\n\x06sheets\x18\x01 \x03(\x0b\x32\x1e.palm.lily.v1.ExcelModel.Sheet\x1ax\n\x05Sheet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x05\x63\x65lls\x18\x02 \x03(\x0b\x32#.palm.lily.v1.ExcelModel.Sheet.Cell\x1a-\n\x04\x43\x65ll\x12\x0b\n\x03row\x18\x01 \x01(\r\x12\x0b\n\x03\x63ol\x18\x02 \x01(\r\x12\x0b\n\x03val\x18\x03 \x01(\t\"r\n\x0cTexToRequest\x12\x34\n\x05\x66iles\x18\x01 \x03(\x0b\x32%.palm.lily.v1.TexToRequest.FilesEntry\x1a,\n\nFilesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"\x12\n\x10\x45pubBuildRequest2|\n\x05\x45xcel\x12\x37\n\x05Parse\x12\x12.palm.lily.v1.File\x1a\x18.palm.lily.v1.ExcelModel\"\x00\x12:\n\x08Generate\x12\x18.palm.lily.v1.ExcelModel\x1a\x12.palm.lily.v1.File\"\x00\x32|\n\x03Tex\x12\x39\n\x05ToPdf\x12\x1a.palm.lily.v1.TexToRequest\x1a\x12.palm.lily.v1.File\"\x00\x12:\n\x06ToWord\x12\x1a.palm.lily.v1.TexToRequest\x1a\x12.palm.lily.v1.File\"\x00\x32\x45\n\x04\x45pub\x12=\n\x05\x42uild\x12\x1e.palm.lily.v1.EpubBuildRequest\x1a\x12.palm.lily.v1.File\"\x00\x42.\n*com.github.saturn_xiv.palm.plugins.lily.v1P\x01\x62\x06proto3')
-
-_globals = globals()
-_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
-_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'lily_pb2', _globals)
-if _descriptor._USE_C_DESCRIPTORS == False:
-
-  DESCRIPTOR._options = None
-  DESCRIPTOR._serialized_options = b'\n*com.github.saturn_xiv.palm.plugins.lily.v1P\001'
-  _TEXTOREQUEST_FILESENTRY._options = None
-  _TEXTOREQUEST_FILESENTRY._serialized_options = b'8\001'
-  _globals['_FILE']._serialized_start=28
-  _globals['_FILE']._serialized_end=95
-  _globals['_EXCELMODEL']._serialized_start=98
-  _globals['_EXCELMODEL']._serialized_end=280
-  _globals['_EXCELMODEL_SHEET']._serialized_start=160
-  _globals['_EXCELMODEL_SHEET']._serialized_end=280
-  _globals['_EXCELMODEL_SHEET_CELL']._serialized_start=235
-  _globals['_EXCELMODEL_SHEET_CELL']._serialized_end=280
-  _globals['_TEXTOREQUEST']._serialized_start=282
-  _globals['_TEXTOREQUEST']._serialized_end=396
-  _globals['_TEXTOREQUEST_FILESENTRY']._serialized_start=352
-  _globals['_TEXTOREQUEST_FILESENTRY']._serialized_end=396
-  _globals['_EPUBBUILDREQUEST']._serialized_start=398
-  _globals['_EPUBBUILDREQUEST']._serialized_end=416
-  _globals['_EXCEL']._serialized_start=418
-  _globals['_EXCEL']._serialized_end=542
-  _globals['_TEX']._serialized_start=544
-  _globals['_TEX']._serialized_end=668
-  _globals['_EPUB']._serialized_start=670
-  _globals['_EPUB']._serialized_end=739
-# @@protoc_insertion_point(module_scope)

+ 5 - 0
rpc/lily/start.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+
+export CODE="mint-lily"
+
+podman run -it --rm --events-backend=file --hostname=palm --network host $CODE

+ 3 - 2
rpc/morus/Dockerfile

@@ -9,7 +9,8 @@ RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
 RUN apt -y upgrade
 ENV PHP_VERSION="8.2"
 RUN apt install -y sudo wget unzip \
-    php${PHP_VERSION}-zip php${PHP_VERSION}-grpc php${PHP_VERSION}-protobuf
+    php${PHP_VERSION}-zip php${PHP_VERSION}-grpc php${PHP_VERSION}-protobuf \
+    php-grpc-all-dev
 RUN apt clean
 
 # https://getcomposer.org/download/
@@ -23,7 +24,7 @@ RUN chown deploy:deploy /opt/morus
 USER deploy
 
 COPY morus /opt/morus/
-# RUN cd /opt/morus && composer install
+RUN cd /opt/morus && composer install
 RUN echo "$(date -u +%4Y%m%d%H%M%S)" | sudo tee /VERSION
 
 WORKDIR /opt/morus

+ 0 - 0
rpc/morus/src/.gitignore → rpc/morus/morus/.gitignore


+ 0 - 0
rpc/morus/src/GPBMetadata/Morus.php → rpc/morus/morus/GPBMetadata/Morus.php


+ 0 - 0
rpc/morus/src/Mint/Morus/V1/MarkdownClient.php → rpc/morus/morus/Mint/Morus/V1/MarkdownClient.php


+ 0 - 0
rpc/morus/src/Mint/Morus/V1/MarkdownToHtmlRequest.php → rpc/morus/morus/Mint/Morus/V1/MarkdownToHtmlRequest.php


+ 0 - 0
rpc/morus/src/Mint/Morus/V1/MarkdownToHtmlResponse.php → rpc/morus/morus/Mint/Morus/V1/MarkdownToHtmlResponse.php


+ 0 - 0
rpc/morus/src/client.php → rpc/morus/morus/client.php


+ 0 - 0
rpc/morus/src/composer.json → rpc/morus/morus/composer.json


+ 0 - 0
rpc/morus/src/server.php → rpc/morus/morus/server.php


BIN
rpc/morus/src/GPBMetadata/Lily.php


+ 0 - 31
rpc/morus/src/Palm/Lily/V1/EpubBuildRequest.php

@@ -1,31 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.EpubBuildRequest</code>
- */
-class EpubBuildRequest extends \Google\Protobuf\Internal\Message
-{
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-}
-

+ 0 - 35
rpc/morus/src/Palm/Lily/V1/EpubClient.php

@@ -1,35 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-namespace Palm\Lily\V1;
-
-/**
- * ----------------------------------------------------------------------------
- *
- */
-class EpubClient extends \Grpc\BaseStub {
-
-    /**
-     * @param string $hostname hostname
-     * @param array $opts channel options
-     * @param \Grpc\Channel $channel (optional) re-use channel object
-     */
-    public function __construct($hostname, $opts, $channel = null) {
-        parent::__construct($hostname, $opts, $channel);
-    }
-
-    /**
-     * @param \Palm\Lily\V1\EpubBuildRequest $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     * @return \Grpc\UnaryCall
-     */
-    public function Build(\Palm\Lily\V1\EpubBuildRequest $argument,
-      $metadata = [], $options = []) {
-        return $this->_simpleRequest('/palm.lily.v1.Epub/Build',
-        $argument,
-        ['\Palm\Lily\V1\File', 'decode'],
-        $metadata, $options);
-    }
-
-}

+ 0 - 49
rpc/morus/src/Palm/Lily/V1/ExcelClient.php

@@ -1,49 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-namespace Palm\Lily\V1;
-
-/**
- * ----------------------------------------------------------------------------
- *
- */
-class ExcelClient extends \Grpc\BaseStub {
-
-    /**
-     * @param string $hostname hostname
-     * @param array $opts channel options
-     * @param \Grpc\Channel $channel (optional) re-use channel object
-     */
-    public function __construct($hostname, $opts, $channel = null) {
-        parent::__construct($hostname, $opts, $channel);
-    }
-
-    /**
-     * @param \Palm\Lily\V1\File $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     * @return \Grpc\UnaryCall
-     */
-    public function Parse(\Palm\Lily\V1\File $argument,
-      $metadata = [], $options = []) {
-        return $this->_simpleRequest('/palm.lily.v1.Excel/Parse',
-        $argument,
-        ['\Palm\Lily\V1\ExcelModel', 'decode'],
-        $metadata, $options);
-    }
-
-    /**
-     * @param \Palm\Lily\V1\ExcelModel $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     * @return \Grpc\UnaryCall
-     */
-    public function Generate(\Palm\Lily\V1\ExcelModel $argument,
-      $metadata = [], $options = []) {
-        return $this->_simpleRequest('/palm.lily.v1.Excel/Generate',
-        $argument,
-        ['\Palm\Lily\V1\File', 'decode'],
-        $metadata, $options);
-    }
-
-}

+ 0 - 58
rpc/morus/src/Palm/Lily/V1/ExcelModel.php

@@ -1,58 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.ExcelModel</code>
- */
-class ExcelModel extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>repeated .palm.lily.v1.ExcelModel.Sheet sheets = 1;</code>
-     */
-    private $sheets;
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type array<\Palm\Lily\V1\ExcelModel\Sheet>|\Google\Protobuf\Internal\RepeatedField $sheets
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>repeated .palm.lily.v1.ExcelModel.Sheet sheets = 1;</code>
-     * @return \Google\Protobuf\Internal\RepeatedField
-     */
-    public function getSheets()
-    {
-        return $this->sheets;
-    }
-
-    /**
-     * Generated from protobuf field <code>repeated .palm.lily.v1.ExcelModel.Sheet sheets = 1;</code>
-     * @param array<\Palm\Lily\V1\ExcelModel\Sheet>|\Google\Protobuf\Internal\RepeatedField $var
-     * @return $this
-     */
-    public function setSheets($var)
-    {
-        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Palm\Lily\V1\ExcelModel\Sheet::class);
-        $this->sheets = $arr;
-
-        return $this;
-    }
-
-}
-

+ 0 - 88
rpc/morus/src/Palm/Lily/V1/ExcelModel/Sheet.php

@@ -1,88 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1\ExcelModel;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.ExcelModel.Sheet</code>
- */
-class Sheet extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>string name = 1;</code>
-     */
-    protected $name = '';
-    /**
-     * Generated from protobuf field <code>repeated .palm.lily.v1.ExcelModel.Sheet.Cell cells = 2;</code>
-     */
-    private $cells;
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type string $name
-     *     @type array<\Palm\Lily\V1\ExcelModel\Sheet\Cell>|\Google\Protobuf\Internal\RepeatedField $cells
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>string name = 1;</code>
-     * @return string
-     */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /**
-     * Generated from protobuf field <code>string name = 1;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setName($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->name = $var;
-
-        return $this;
-    }
-
-    /**
-     * Generated from protobuf field <code>repeated .palm.lily.v1.ExcelModel.Sheet.Cell cells = 2;</code>
-     * @return \Google\Protobuf\Internal\RepeatedField
-     */
-    public function getCells()
-    {
-        return $this->cells;
-    }
-
-    /**
-     * Generated from protobuf field <code>repeated .palm.lily.v1.ExcelModel.Sheet.Cell cells = 2;</code>
-     * @param array<\Palm\Lily\V1\ExcelModel\Sheet\Cell>|\Google\Protobuf\Internal\RepeatedField $var
-     * @return $this
-     */
-    public function setCells($var)
-    {
-        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Palm\Lily\V1\ExcelModel\Sheet\Cell::class);
-        $this->cells = $arr;
-
-        return $this;
-    }
-
-}
-
-// Adding a class alias for backwards compatibility with the previous class name.
-class_alias(Sheet::class, \Palm\Lily\V1\ExcelModel_Sheet::class);
-

+ 0 - 115
rpc/morus/src/Palm/Lily/V1/ExcelModel/Sheet/Cell.php

@@ -1,115 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1\ExcelModel\Sheet;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.ExcelModel.Sheet.Cell</code>
- */
-class Cell extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>uint32 row = 1;</code>
-     */
-    protected $row = 0;
-    /**
-     * Generated from protobuf field <code>uint32 col = 2;</code>
-     */
-    protected $col = 0;
-    /**
-     * Generated from protobuf field <code>string val = 3;</code>
-     */
-    protected $val = '';
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type int $row
-     *     @type int $col
-     *     @type string $val
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>uint32 row = 1;</code>
-     * @return int
-     */
-    public function getRow()
-    {
-        return $this->row;
-    }
-
-    /**
-     * Generated from protobuf field <code>uint32 row = 1;</code>
-     * @param int $var
-     * @return $this
-     */
-    public function setRow($var)
-    {
-        GPBUtil::checkUint32($var);
-        $this->row = $var;
-
-        return $this;
-    }
-
-    /**
-     * Generated from protobuf field <code>uint32 col = 2;</code>
-     * @return int
-     */
-    public function getCol()
-    {
-        return $this->col;
-    }
-
-    /**
-     * Generated from protobuf field <code>uint32 col = 2;</code>
-     * @param int $var
-     * @return $this
-     */
-    public function setCol($var)
-    {
-        GPBUtil::checkUint32($var);
-        $this->col = $var;
-
-        return $this;
-    }
-
-    /**
-     * Generated from protobuf field <code>string val = 3;</code>
-     * @return string
-     */
-    public function getVal()
-    {
-        return $this->val;
-    }
-
-    /**
-     * Generated from protobuf field <code>string val = 3;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setVal($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->val = $var;
-
-        return $this;
-    }
-
-}
-
-// Adding a class alias for backwards compatibility with the previous class name.
-class_alias(Cell::class, \Palm\Lily\V1\ExcelModel_Sheet_Cell::class);
-

+ 0 - 95
rpc/morus/src/Palm/Lily/V1/File.php

@@ -1,95 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.File</code>
- */
-class File extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>optional string content_type = 1;</code>
-     */
-    protected $content_type = null;
-    /**
-     * Generated from protobuf field <code>bytes payload = 2;</code>
-     */
-    protected $payload = '';
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type string $content_type
-     *     @type string $payload
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>optional string content_type = 1;</code>
-     * @return string
-     */
-    public function getContentType()
-    {
-        return isset($this->content_type) ? $this->content_type : '';
-    }
-
-    public function hasContentType()
-    {
-        return isset($this->content_type);
-    }
-
-    public function clearContentType()
-    {
-        unset($this->content_type);
-    }
-
-    /**
-     * Generated from protobuf field <code>optional string content_type = 1;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setContentType($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->content_type = $var;
-
-        return $this;
-    }
-
-    /**
-     * Generated from protobuf field <code>bytes payload = 2;</code>
-     * @return string
-     */
-    public function getPayload()
-    {
-        return $this->payload;
-    }
-
-    /**
-     * Generated from protobuf field <code>bytes payload = 2;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setPayload($var)
-    {
-        GPBUtil::checkString($var, False);
-        $this->payload = $var;
-
-        return $this;
-    }
-
-}
-

+ 0 - 49
rpc/morus/src/Palm/Lily/V1/TexClient.php

@@ -1,49 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-namespace Palm\Lily\V1;
-
-/**
- * ----------------------------------------------------------------------------
- *
- */
-class TexClient extends \Grpc\BaseStub {
-
-    /**
-     * @param string $hostname hostname
-     * @param array $opts channel options
-     * @param \Grpc\Channel $channel (optional) re-use channel object
-     */
-    public function __construct($hostname, $opts, $channel = null) {
-        parent::__construct($hostname, $opts, $channel);
-    }
-
-    /**
-     * @param \Palm\Lily\V1\TexToRequest $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     * @return \Grpc\UnaryCall
-     */
-    public function ToPdf(\Palm\Lily\V1\TexToRequest $argument,
-      $metadata = [], $options = []) {
-        return $this->_simpleRequest('/palm.lily.v1.Tex/ToPdf',
-        $argument,
-        ['\Palm\Lily\V1\File', 'decode'],
-        $metadata, $options);
-    }
-
-    /**
-     * @param \Palm\Lily\V1\TexToRequest $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     * @return \Grpc\UnaryCall
-     */
-    public function ToWord(\Palm\Lily\V1\TexToRequest $argument,
-      $metadata = [], $options = []) {
-        return $this->_simpleRequest('/palm.lily.v1.Tex/ToWord',
-        $argument,
-        ['\Palm\Lily\V1\File', 'decode'],
-        $metadata, $options);
-    }
-
-}

+ 0 - 58
rpc/morus/src/Palm/Lily/V1/TexToRequest.php

@@ -1,58 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.TexToRequest</code>
- */
-class TexToRequest extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>map<string, bytes> files = 1;</code>
-     */
-    private $files;
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type array|\Google\Protobuf\Internal\MapField $files
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>map<string, bytes> files = 1;</code>
-     * @return \Google\Protobuf\Internal\MapField
-     */
-    public function getFiles()
-    {
-        return $this->files;
-    }
-
-    /**
-     * Generated from protobuf field <code>map<string, bytes> files = 1;</code>
-     * @param array|\Google\Protobuf\Internal\MapField $var
-     * @return $this
-     */
-    public function setFiles($var)
-    {
-        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::BYTES);
-        $this->files = $arr;
-
-        return $this;
-    }
-
-}
-

+ 0 - 88
rpc/morus/src/Palm/Lily/V1/TexToRequest/File.php

@@ -1,88 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: lily.proto
-
-namespace Palm\Lily\V1\TexToRequest;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>palm.lily.v1.TexToRequest.File</code>
- */
-class File extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>string name = 1;</code>
-     */
-    protected $name = '';
-    /**
-     * Generated from protobuf field <code>bytes content = 2;</code>
-     */
-    protected $content = '';
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type string $name
-     *     @type string $content
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Lily::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>string name = 1;</code>
-     * @return string
-     */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /**
-     * Generated from protobuf field <code>string name = 1;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setName($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->name = $var;
-
-        return $this;
-    }
-
-    /**
-     * Generated from protobuf field <code>bytes content = 2;</code>
-     * @return string
-     */
-    public function getContent()
-    {
-        return $this->content;
-    }
-
-    /**
-     * Generated from protobuf field <code>bytes content = 2;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setContent($var)
-    {
-        GPBUtil::checkString($var, False);
-        $this->content = $var;
-
-        return $this;
-    }
-
-}
-
-// Adding a class alias for backwards compatibility with the previous class name.
-class_alias(File::class, \Palm\Lily\V1\TexToRequest_File::class);
-

+ 1 - 1
rpc/morus/start.sh

@@ -2,4 +2,4 @@
 
 export CODE="mint-morus"
 
-podman run -it --rm --events-backend=file --hostname=palm --network host -v $PWD:/workspace:z $CODE
+podman run -it --rm --events-backend=file --hostname=palm --network host $CODE

+ 49 - 13
rpc/schema.sh

@@ -9,19 +9,7 @@ export WORKSPACE=$PWD
 
 # if [[ "$1" == "php" ]]
 #         then
-#             declare -a folders=(
-#                 "GPBMetadata"
-#                 "Mint"
-#                 "Palm"
-#             )
-#             for f in "${folders[@]}"
-#             do
-#                 local t=$target/$1/$f
-#                 if [ -d $t ]
-#                 then
-#                     rm -f $t
-#                 fi
-#             done            
+           
 #         else
             
 #         fi
@@ -63,6 +51,51 @@ function generate_grpc_web() {
         $WORKSPACE/protocols/*.proto
 }
 
+function generate_for_morus() {
+    echo "generate code for morus project"
+    local target=$WORKSPACE/morus/morus
+    local -a folders=(
+        "GPBMetadata"
+        "Mint"
+        "Palm"
+    )
+    for f in "${folders[@]}"
+    do
+        local t=$target/$f
+        if [ -d $t ]
+        then
+            rm -r $t
+        fi
+    done
+    $PROTOBUF_ROOT/bin/protoc -I $WORKSPACE/protocols \
+        -I $PROTOBUF_ROOT/include/google/protobuf \
+        --php_out=$target --grpc_out=$target \
+        --plugin=protoc-gen-grpc=$PROTOBUF_ROOT/bin/grpc_php_plugin \
+        $WORKSPACE/protocols/morus.proto
+}
+
+function generate_for_lily() {
+    echo "generate code for lily project"
+    local target=$WORKSPACE/lily/lily/palm
+    local -a files=(        
+        "lily_pb2.py"
+        "lily_pb2_grpc.py"
+    )
+    for f in "${files[@]}"
+    do
+        local t=$target/$f
+        if [ -f $t ]
+        then
+            rm $t
+        fi
+    done
+    $PROTOBUF_ROOT/bin/protoc -I $WORKSPACE/protocols \
+        -I $PROTOBUF_ROOT/include/google/protobuf \
+        --python_out=$target --grpc_out=$target \
+        --plugin=protoc-gen-grpc=$PROTOBUF_ROOT/bin/grpc_python_plugin \
+        $WORKSPACE/protocols/lily.proto
+    sed -i 's/import lily_/from . import lily_/g' $target/lily_pb2_grpc.py
+}
 
 # -----------------------------------------------------------------------------
 
@@ -80,6 +113,9 @@ do
     generate_grpc_by_lang $l
 done
 
+generate_for_morus
+generate_for_lily
+
 generate_grpc_web $WORKSPACE/../dashboard
 
 # ----------------------------------------------------------