Skip to content

Commit 888ad78

Browse files
refactor: plugin lifecycle control panel (#499)
* refactor: introduce local plugin control panel and cleanup environment setup process * fix: args * refactor: new local runtime * temp: stash work for refactor on RemotePluginServer * refactor: unify local runtime lifetime and sperate init environment process * chore: add missing files * stash * refactor: local plugin lifetime control * refactor: complete installation process of control panel * refactor: adapt service layer to new controlpanel * refactor: pluginManager.Install * fix: add routine wrap to InstallServerless, avoid blocking main thread * feat: reinstall serverless runtime * chore: add comments to Reinstall and update confusing naming * refactor: unify install plugin service * refactor: add labels to debugging runtime * refactor: add getters to plugin manager * refactor: split install service to decode/install_task/install service * ??? * refactor: adapt controllers * refactor: session write * refactor: session runtime * Refine install task orchestration (#501) * refactor: installing task * refactor cluster management, decouple lifetime management and cluster * fix cli test command * fix: cleanup TODO comments and implement GracefulStop for instance * feat: add logger to control panel * fix: multiple nil references * refactor: better lifetime control * refactor: better cycle interval * fix(LocalPluginRuntime): prevent returning err when it's not error * fix: avoid adding empty PipExtraArgs * fix: missing errors in Environment init * fix: add truncateMessage to avoid db explosion * cleanup: better lifecycle management * fix: init status at the beginning of installation * optimize: GracefulStop for pluginInstance * refactor: tests * refactor: centralize routine labels (#504) * cleanup: RoutineKey * fix: init routine pool * fix: correctly handle cluster register error * fix: memory leak * fix: add \n to instance write * fix(installer.go): set success to true after succeed for defer func * refactor * fix: missing cwd in testutils * fix: scaleup default runtime nums to 1 when testing * fix: localruntime appconfig in testing module * Update internal/core/local_runtime/load_balancing.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fix: more efficiency implement in installer_local.go * fix: returns after failing in onDebuggingRuntimeDisconnected * fix: returns after failing in onDebuggingRuntimeDisconnected * fix: splits tests * refactor: naming * refactor: manifest.VersionX * fix: adapt SetDefault to tests * fix: enforce use constants in DBType * fix: generate * fix: linter * cleanup tests * refactor: change package to * cleanup: useless codes * Update internal/cluster/plugin.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * cleanup * refactor: decouple connection_key management from debugging_time * refactor: confused naming * feat: recycle resources to adapt to #500 * refactor: confusing redirecting * fix: support get serverless runtime * fix: race condition in Launching * fix: avoid ManifestValidate in first step of debugging handshake * fix: adding ReleaseAllLocks to finalizers * wtf: what a beautiful code * refactor: rename Stream.Async to Stream.Process * fix: kill process if daed instance was detected * fix: correctly handle failures * fix: consistence of difference interfaces * fix: add stacktrace to panic * fix: only trigger once event * fix: ensure plugin runtime was shutdown * feat: cleanup install tasks * fix: add scale logs --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ad4a7c4 commit 888ad78

File tree

305 files changed

+6569
-5252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+6569
-5252
lines changed

cmd/commandline/bundle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"strconv"
77

88
"github.com/langgenius/dify-plugin-daemon/cmd/commandline/bundle"
9-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
109
"github.com/langgenius/dify-plugin-daemon/pkg/entities/bundle_entities"
10+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
1111
"github.com/spf13/cobra"
1212
)
1313

cmd/commandline/bundle/bump_version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package bundle
22

33
import (
4-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
54
"github.com/langgenius/dify-plugin-daemon/pkg/entities/manifest_entities"
5+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
66
)
77

88
func BumpVersion(bundlePath string, targetVersion string) {

cmd/commandline/bundle/dep.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package bundle
33
import (
44
"os"
55

6-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
76
"github.com/langgenius/dify-plugin-daemon/pkg/bundle_packager"
87
"github.com/langgenius/dify-plugin-daemon/pkg/entities/bundle_entities"
8+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
99
)
1010

1111
func loadBundlePackager(bundlePath string) (bundle_packager.BundlePackager, error) {

cmd/commandline/bundle/encoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package bundle
33
import (
44
"bytes"
55

6-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
6+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
77
"gopkg.in/yaml.v3"
88
)
99

cmd/commandline/bundle/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
"text/template"
1010
"time"
1111

12-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
1312
"github.com/langgenius/dify-plugin-daemon/pkg/entities/bundle_entities"
1413
"github.com/langgenius/dify-plugin-daemon/pkg/entities/manifest_entities"
1514
"github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities"
15+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
1616

1717
tea "github.com/charmbracelet/bubbletea"
1818
)

cmd/commandline/bundle/package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package bundle
33
import (
44
"os"
55

6-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
6+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
77
)
88

99
func PackageBundle(bundlePath string, outputPath string) {

cmd/commandline/plugin/checksum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package plugin
33
import (
44
"os"
55

6-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
76
"github.com/langgenius/dify-plugin-daemon/pkg/plugin_packager/decoder"
7+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
88
)
99

1010
func CalculateChecksum(pluginPath string) {

cmd/commandline/plugin/encoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package plugin
33
import (
44
"bytes"
55

6-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
6+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
77
"gopkg.in/yaml.v3"
88
)
99

cmd/commandline/plugin/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
_ "embed"
1010

1111
tea "github.com/charmbracelet/bubbletea"
12-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
13-
"github.com/langgenius/dify-plugin-daemon/internal/utils/parser"
1412
"github.com/langgenius/dify-plugin-daemon/pkg/entities/constants"
1513
"github.com/langgenius/dify-plugin-daemon/pkg/entities/manifest_entities"
1614
"github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities"
15+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
16+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/parser"
1717
)
1818

1919
var (

cmd/commandline/plugin/list_readme.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"os"
66
"text/tabwriter"
77

8-
"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
98
"github.com/langgenius/dify-plugin-daemon/pkg/plugin_packager/decoder"
9+
"github.com/langgenius/dify-plugin-daemon/pkg/utils/log"
1010
)
1111

1212
// Language represents supported README languages

0 commit comments

Comments
 (0)