Go Directives & Automation Tools Deep Dive

These go: instructions in the Go source code && go automation tools Developers have a strong tendency to automate repetitive tasks, and this also applies to writing code. Boilerplate code may include operations such as setting up a basic file structure, initializing variables, defining functions, or importing libraries or modules. In some cases, packages provide boilerplate code as a starting point for developers to build from, typically generated after the code behavior has been configured. Although boilerplate code may be necessary and valuable to application functionality, it can also be wasteful and redundant. For this reason, there are many tools that minimize boilerplate code. go generate is a command line tool for the Go programming language that allows automatic code generation. You can use go generate to generate easily modifiable code specific to your project, making the tool powerful at reducing boilerplate. go generate This command is usually used to automatically generate code before compilation. It can be used to create repetitive or patterned code, thereby saving time and reducing errors. Think about it, in what situations would this be particularly useful? 🤔 ...

January 25, 2024 · 22 min · 4561 words · Xinwei Xiong, Me

Concurrent Type Checking and Cross-Platform Development in Go

OpenIM cross-platform source code type checking tool start question In the automation path of OpenIM, it involves more and more comprehensive automated design and testing. In the process, I encountered a problem, so I completed a full set of experience from go language type detection to integrated local and CI. The problem is this issue: https://github.com/openimsdk/open-im-server/issues/1807 Our Go code encountered an integer overflow issue when running on a 32-bit system (linux/386). This problem occurs because the int type in Go has different sizes depending on the architecture: on 32-bit systems it is equivalent to int32, and on 64-bit systems it is equivalent to int64. ...

January 24, 2024 · 31 min · 6471 words · Xinwei Xiong, Me
Vector database learning

Vector Database Learning

Vector database learning I learned rust today and found that rust is a very suitable language for writing databases. I found a treasure project tikv. Its github project address is https://github.com/tikv/tikv . It is a very active project, but today I The topic is vector database in the field of AI. Without further ado, let’s get started right away. prerequisites 0.1 Introduction to basic knowledge: Understand the basic definition of vector database and its difference from traditional database. 0.2 Data Structure Basics: Learn vectors and other basic data structures, and how to represent and manipulate these structures in databases. 0.3 Introduction to Linear Algebra: Introduction to vector operations, including vector addition, subtraction and dot multiplication. 0.4 Similarity measures: Learn how to calculate similarity between vectors, such as cosine similarity. 0.5 Basics of Database Index: Introduces the basic concepts of database index, especially its application in vector databases. 0.6 Preliminary Search Algorithms: Learn basic search algorithms and understand how to perform effective searches in large data sets. 0.7 Application case studies: Study the application of vector databases in different fields (such as recommendation systems, image recognition). ...

January 20, 2024 · 39 min · 8125 words · Xinwei Xiong, Me

OpenIM: Version Control & Testing Workflow

The success of an open-source project largely depends on its quality management and collaborative processes. In the OpenIM open-source community, the standardization of project management and testing processes is crucial to ensure the quality and stability of the codebase. This document provides a brief overview of our testing strategy, branch management, quality control policies, and how they are applied to the main branch, PR testing branches, and stable release branches to meet the needs of developers, testers, and community managers. Additionally, we will introduce the standards, testing schemes, and project management strategies of the OpenIM open-source community, aiming to provide clear guidance to ensure project stability and sustainability. ...

January 15, 2024 · 5 min · 1023 words · Xinwei Xiong, Me

Emerging Challenges and Trends in 2024

Large language model sharing meeting on January 6, 2024 Limitations of the model: Deep learning Pre-trained model Large language model The emergent power of large language models: 💡 Relevant research on emergence phenomena has been done for a long time in the discipline of complex systems. So, what is “emergent phenomenon”? When a complex system is composed of many tiny individuals, these tiny individuals come together and interact with each other. When the number is large enough, they exhibit special phenomena that cannot be explained by the microscopic individuals at the macro level. This can be called an "emergent phenomenon." Link: ...

January 14, 2024 · 10 min · 2002 words · Xinwei Xiong, Me

GitOps & Kubernetes Deployment Strategies

Today we will take a look at the theory and practice of kubernetes and gitops Command introduction First, let’s take a look at the subnaming supported by kubectl for our convenience: kubectl apply - applies the definition of one or more resources. Typically used to deploy applications or update resources. kubectl get - displays information about one or more resources. This is a common command to view the status of resources in a Kubernetes cluster. kubectl describe - Displays details of one or more resources, such as events, status, and configuration. kubectl delete - Delete resources in the Kubernetes cluster. kubectl exec - Execute commands in containers in the cluster. kubectl logs - Print container logs. kubectl create - Create one or more resources from a file or standard input. kubectl edit - Edit resources in the cluster. This will open an editor to modify the resource’s configuration. kubectl port-forward - Forward local ports to Pods in the cluster. kubectl run - Run a specified image in the cluster. kubectl scale - Adjust the number of replicas of resources (such as Deployment, ReplicaSet). kubectl rollout - Manage the deployment of resources, such as viewing status, pausing, resuming or rolling back updates. **In addition to the above commands, kubectl in Kubernetes also supports annotations: ** ...

November 25, 2023 · 42 min · 8858 words · Xinwei Xiong, Me

Deployment and Design of Management Backend and Monitoring

OpenIM offers various flexible deployment options to suit different environments and requirements. Here is a simplified and optimized description of these deployment options: Source Code Deployment: Regular Source Code Deployment: Deployment using the nohup method. This is a basic deployment method suitable for development and testing environments. For details, refer to the Regular Source Code Deployment Guide . Production-Level Deployment: Deployment using the system method, more suitable for production environments. This method provides higher stability and reliability. For details, refer to the Production-Level Deployment Guide . Cluster Deployment: Kubernetes Deployment: Provides two deployment methods, including deployment through Helm and sealos. This is suitable for environments that require high availability and scalability. Specific methods can be found in the Kubernetes Deployment Guide . Docker Deployment: Regular Docker Deployment: Suitable for quick deployments and small projects. For detailed information, refer to the Docker Deployment Guide . Docker Compose Deployment: Provides more convenient service management and configuration, suitable for complex multi-container applications. Next, we will introduce the specific steps, monitoring, and management backend configuration for each of these deployment methods, as well as usage tips to help you choose the most suitable deployment option according to your needs. ...

November 15, 2023 · 7 min · 1366 words · Xinwei Xiong, Me

Hugo Advanced Tutorial

136: Hugo Advanced Coming to the advanced part, you need to learn some advanced Hugo techniques in depth. Module Hugo modules are the core building blocks of Hugo. A module can be your main project or a smaller module that provides one or more of the 7* component types defined in Hugo: static, content, layouts, data, assets, i18n and archetypes. You can combine modules in any combination you like, and you can even mount directories from non-Hugo projects to form a large virtual union file system. ...

November 6, 2023 · 34 min · 7121 words · Xinwei Xiong, Me

Kubernetes for Kustomize Learning

Introduction About Kustomize GitHub Repository Get Started Kustomize is an open-source configuration management tool designed specifically for Kubernetes. It helps users customize Kubernetes objects and manage them declaratively without modifying the original YAML files . This means you can retain the basic settings for applications and components while overriding default settings with declarative YAML documents called “patches” without altering the original files. Kustomize provides a declarative approach that aligns with Kubernetes philosophy and allows customization of Kubernetes configurations in a reusable, fast, debuggable, and scalable manner. ...

October 31, 2023 · 24 min · 4998 words · Xinwei Xiong, Me

OpenIM Use Harbor Build Enterprise Mirror Repositories

Requirements OpenIM provides various public image registry addresses, such as aliyun, github, Docker Hub, and more. Read https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md for more image building guidelines. Most enterprises choose to set up their own image repository using Harbor, integrating it into their CI/CD pipeline to eventually replace Docker Hub and further reduce image storage costs. Additionally, in a production environment, Harbor generally enables TLS, so you will also need to prepare a valid domain name. ...

October 25, 2023 · 5 min · 1009 words · Xinwei Xiong, Me