Building images without Dockerfile: BuildPack vs Dockerfile

In the past, we have built technology platforms using microservices, containerization, and service orchestration. To improve the efficiency of our development teams, we also provide the CICD platform for rapid deployment of code to Openshift (an enterprise-class Kubernetes) clusters. The first step of deployment is to containerize the application, and the continuous integration deliverables have changed from jar packages, webpack, etc. to container images. Containerization packages the software code and

DDD in the end is garbage or silver bullets

Every once in a while, someone will jump out and criticize DDD, is it a piece of junk or a silver bullet? When I was working in a certain company, there was a group of people who claimed that they wanted to use DDD to transform the old system and completely solve the problem of difficult to maintain the project after the core process was scaled. This diagram in a previous article is the mess before the project refactoring with DDD.

Earthly A more powerful image builder

Introduction to Earthly Earthly is a more advanced Docker image builder, Earthly replaces the traditional Dockerfile with its own Earthfile; Earthfile is as Earthly officially describes: Makefile + Dockerfile = Earthfile Earthly supports some Dockerfile extension syntax through buildkit, and integrates Dockerfile with Makefile, making it easier to build and code Dockerfile for multiple platforms; Earthly makes it easier to reuse Dockerfile code and more CI-friendly automatic integration. Quick Start

Timeout control in Go

In daily development we will probably encounter timeout control scenarios, such as a batch of time-consuming tasks, network requests, etc.; a good timeout control can effectively avoid some problems (such as goroutine leakage, resource non-release, etc.). Timer The first option is Time.After(d Duration): the timeout control in go is very simple. 1 2 3 4 5 func main() { fmt.Println(time.Now()) x := <-time.After(3 * time.Second) fmt.Println(x) } output: 1 2

Go Generics - Simplify again, omitting interfaces

If you have been paying attention to the design and implementation of Go generic type, you must know that Go generic code implementation is implemented by type parameter (type parameter), which is replaced by type argument (type argument) when running generic code. (unfortunately both parameter and argument are translated into Chinese parameters) The type parameter also has a type, which is the metadata that describes the behavior of the parameter type, and is called a constraint.

Python chatbot building based on AIML

AIML Introduction AIML, known as Artificial Intelligence Markup Language, is an XML language for creating natural language software agents, invented and created by Dr. Richard S. Wallace and the Alicebot open source software organization between 1995-2000. AIML is an XML format for rule definition in order to match patterns and determine responses. The design goals of AIML are as follows. AIML should be easy for the general public to learn

Python JSON/JSONP Data Parsing

JSON Introduction JSON, JavaScript Object Natation, is a lightweight data interchange format that is ideal for server interaction with JavaScript. In ordinary Web applications, developers often struggle with XML parsing, either server-side generation or processing of XML, or client-side parsing of XML with JavaScript, often resulting in complex code and very low development efficiency. In fact, for most Web applications, many AJAX applications even return pieces of HTML directly to

Python XML file format parsing

XML refers to Extensible Markup Language, a subset of the Standard Generalized Markup Language, a markup language used to mark up electronic documents to make them structured. XML is designed to transfer and store data. Python has three common ways of parsing XML: SAX (simple API for XML), DOM (Document Object Model), and ElementTree. DOM approach: DOM, translated as Document Object Model, is a standard programming interface recommended by the

Disk Array RAID Types and Comparisons

In the stand-alone era, the use of a single disk for data storage and read/write resulted in very low I/O performance due to addressing and read/write time consumption, and the storage capacity would also be limited. In addition, a single disk is extremely prone to physical failure, often resulting in data loss. Therefore, people wonder if there is a way to combine multiple independent disks together to form a technical solution to improve data reliability and I/O performance.

Python object persistence storage tool pickle

Python has a serialization process called pickle, which enables interconversion between arbitrary objects and text, and between arbitrary objects and binary. In other words, pickle enables the storage and recovery of Python objects. Serialization (picking): The process of turning a variable from memory into something that can be stored or transferred is called serialization, and after serialization, you can write the serialized object to disk or transfer it to another

Python file reading and writing operations

When programming in Python, you will often encounter operations that read and write files. The various modes of reading and writing files (such as read, write, append, etc.) can sometimes be really confusing, as well as confusing the use of methods such as open, read, readline, readlines, write, writelines, etc. can also throw you for a loop. I hope this article will help you better understand how to read and

JupyterLab HIVE Data Synchronization Process

The company’s data is stored on HDFS, but the model training needs to use this data, so there is a need for data synchronization. The following is a personal data synchronization process, which is only applicable to the company, and may not be available in other places due to different environments. Data synchronization from Hive to JupyterLab View data file locations via Hive The path to the database table can be viewed via Hive’s show create table statement.

Python pip source and Anaconda conda source modification

Due to some unavoidable factors, the official Python packages are sometimes inaccessible or have network instability in China. conda source also has the problem of network link failure. To solve this problem, here are some configuration methods to sort out. Pip vs. Conda Dependency checking pip: does not always show the required additional dependencies. When installing a package, it may simply ignore the dependencies and install them, only indicating errors

Linux/Windows/Mac OS file systems

A computer’s file system is a method of storing and organizing computer data, which makes it easy to access and find. A file system uses the abstract logical concept of files and tree directories instead of using the concept of data blocks for physical devices such as hard disks and CD-ROMs, so that users using a file system to save data do not have to care about how much data is actually saved on the hard disk (or CD-ROM) at the address of the data block, but only need to You only need to remember the directory and file name of the file.

PHP Integrated Runtime Environment XAMPP

PHP is not as hot as when personal websites were booming, but many of the open source programs left during the period are still very valuable to learn and use, such as this blog is using WordPress. in the process of studying PHP code you need to deploy the PHP runtime environment, the easier way is to use the integrated runtime environment. PHP Integrated Runtime Environment PHP integrated runtime environment

Finding User Sessions With Sql

In the PC era, when a user asks for a page, we will first check whether a SessionId exists in the user’s cookie, and if it does not exist, we will generate a SessionId by random number and store it in the cookie. If it exists, we will update the expiration time of this cookie (after 30 minutes). That is, as long as the user visits the interval within 30 minutes is considered the same Seesion, more than 30 minutes will generate a new SeesionId and define browsing as a new Session.

Universally Unique Identifier

In complex distributed systems, it is often necessary to uniquely identify a large number of data and messages. A unique ID is needed to identify a piece of data or a message after the data is divided into libraries and tables, and the self-incrementing ID of the database obviously does not meet the demand at this time a system that can generate a globally unique ID is very necessary. To

Readability, a web body extraction tool

What is Readability? If you see a good article on the Internet and want to save it for later reading, but don’t want to save a lot of green ads or irrelevant web elements at the same time, then you can try Readability! Readability is a unique “read later” web favorites service that not only allows you to bookmark articles you like, but also has the best feature of automatically and intelligently eliminating some unimportant elements on the web page and reformatting them to present you with a clean and tidy body part, making your better reading experience!

Using the Python Logging Module

logging module is a standard module built in Python, mainly used for outputting runtime logs, you can set the output log level, log save path, log file rollback, etc. Compared with print, it has the following advantages. you can set different logging levels to output only important information in the release version without having to display a lot of debugging information print outputs all the information to the standard output,

Python modules, packages, libraries, frameworks

In the process of using Python, I often get confused by the concepts of modules, libraries, packages, and frameworks. Today, we will take time to sort out these concepts. Module A module is a file with a .py suffix in which constants and functions are defined. The name of a module is the name of that .py file. The name of the module is taken as a global variable __name__ that can be fetched or imported by other modules.