Skip to content

Commit

Permalink
Some renamings (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok authored Oct 7, 2023
1 parent d76e219 commit a92277a
Show file tree
Hide file tree
Showing 74 changed files with 51 additions and 59 deletions.
4 changes: 2 additions & 2 deletions .dx/sources.yml → .dx/codebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--no-snapshot-updates
--batch-mode
{% if focus == 'solution' %}
--projects apps/foo
--projects apps/sepuling
{% elif focus == 'pipeline' %}
--projects tests/e2e
{% endif %}
Expand All @@ -30,7 +30,7 @@
# list all top level playbooks
cmd: >
ansible-lint
sources.yml
codebase.yml
stacks.yml
strip_empty_ends: false
changed_when: false
Expand Down
14 changes: 7 additions & 7 deletions .dx/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ prefs: turing

lib_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs')[:7] }}"
lib_cids:
signatures: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/signatures')[:7] }}"
storage: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/storage')[:7] }}"
abstraction: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/abstraction')[:7] }}"
essentials: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/essentials')[:7] }}"
messaging: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/messaging')[:7] }}"
storage: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/storage')[:7] }}"
testing: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs/testing')[:7] }}"
app_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=apps')[:7] }}"
app_cids:
foo: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=apps/foo')[:7] }}"
sepuling: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=apps/sepuling')[:7] }}"
schema_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=schemas')[:7] }}"
schema_cids:
postgres: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=schemas/postgres')[:7] }}"
Expand All @@ -34,14 +34,14 @@ pipeline_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.githu

# solution - focus on solution changes
# pipeline - focus on pipeline changes
# none - without any particular focus
focus: none
# null - without any particular focus
focus: null

binary_repo: local
image_repo: local

app_images:
foo: "{{ image_repo }}/{{ organization }}/{{ project }}/app/foo"
sepuling: "{{ image_repo }}/{{ organization }}/{{ project }}/app/sepuling"
schema_images:
postgres: "{{ image_repo }}/{{ organization }}/{{ project }}/schema/postgres"
stack_images:
Expand All @@ -51,4 +51,4 @@ stack_images:
docker_entity: "{{ 'image' if image_repo == 'local' else 'manifest' }}"

app_deps:
foo: [essentials, signatures, messaging, storage]
sepuling: [abstraction, essentials, messaging, storage]
10 changes: 5 additions & 5 deletions .dx/tasks/solution/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
ansible.builtin.command:
cmd: >
docker compose
--file basis/compose.yml
--file {{ usage }}/compose.yml
--file usages/basis.yml
--file usages/{{ usage }}.yml
--profile {{ prefs }}
config
--output target/context/compose.yml
Expand All @@ -32,8 +32,8 @@
environment:
SCHEMA_TAG: "{{ schema_cids.postgres }}"
SCHEMA_IMAGE: "{{ schema_images.postgres }}"
FOO_TAG: "{{ hostvars.app.image_cids.foo[:7] }}"
FOO_IMAGE: "{{ app_images.foo }}"
SEPULING_TAG: "{{ hostvars.app.image_cids.sepuling[:7] }}"
SEPULING_IMAGE: "{{ app_images.sepuling }}"
CONFIG_FILE_NAME: "{{ config_files[prefs] }}"
CONFIG_MAPPING_MODE: "{{ config_mapping_modes[prefs] }}"
changed_when: true
Expand All @@ -45,7 +45,7 @@
church: conf
ansible.builtin.command:
cmd: >
cp basis/{{ prefs }}.{{ config_extensions[prefs] }}
cp prefs/{{ prefs }}.{{ config_extensions[prefs] }}
target/context/application.{{ config_extensions[prefs] }}
chdir: "{{ playbook_dir }}/../solutions"
changed_when: true
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ updates:
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/apps/foo"
directory: "/apps/sepuling"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pipeline-beyond-doubt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: ${{ matrix.environ.name }}
tools: python java docker
token: ${{ secrets.GITHUB_TOKEN }}
- run: ansible-playbook sources.yml -e focus=pipeline
- run: ansible-playbook codebase.yml -e focus=pipeline
working-directory: .dx
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pipeline-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
revision: ${{ matrix.environ.name }}
tools: python java
- run: ansible-playbook sources.yml -e focus=pipeline
- run: ansible-playbook codebase.yml -e focus=pipeline
working-directory: .dx
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solution-beyond-doubt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
tools: python java docker
token: ${{ secrets.GITHUB_TOKEN }}
- run: ansible-playbook sources.yml -e focus=solution
- run: ansible-playbook codebase.yml -e focus=solution
working-directory: .dx
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solution-convincing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
tools: python java docker
token: ${{ secrets.GITHUB_TOKEN }}
- run: ansible-playbook sources.yml -e focus=solution
- run: ansible-playbook codebase.yml -e focus=solution
working-directory: .dx
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solution-sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: ./.github/actions/prepare
with:
tools: python java
- run: ansible-playbook sources.yml -e focus=solution
- run: ansible-playbook codebase.yml -e focus=solution
working-directory: .dx
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<version>${revision}</version>

<modules>
<module>foo</module>
<module>sepuling</module>
</modules>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion apps/foo/Dockerfile → apps/sepuling/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RUN addgroup -S bezmen && adduser -S bezmen -G bezmen
USER bezmen:bezmen
WORKDIR /home/bezmen
COPY libs libs
COPY app*.jar app.jar
COPY sepuling*.jar app.jar
ENTRYPOINT [ \
"java", "-cp", "app.jar:libs/*", \
"-Dconfig.file=application.conf", \
Expand Down
2 changes: 1 addition & 1 deletion apps/foo/pom.xml → apps/sepuling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<version>${revision}</version>
</parent>

<artifactId>app-foo</artifactId>
<artifactId>sepuling</artifactId>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public record SepulkaController(

@PostMapping
ResponseEntity<SepulkaRegResMsg> register(@RequestBody SepulkaRegReqMsg sepulkaRegReqMsg) {
// TODO: контроллер отвечает только за сборку msg-модели и валидацию
validator.validate(sepulkaRegReqMsg);
SepulkaRegReq sepulkaRegReq = mapper.toDomain(sepulkaRegReqMsg);
SepulkaRegRes sepulkaRegRes = client.register(sepulkaRegReq);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public DataSource dataSource(StorageProps storageProps) {
return new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.H2)
.setName(nameWithSettings)
.addScript("/schemas/alfa/drop.sql")
.addScript("/schemas/alfa/create.sql")
.addScript("/schemas/sepulkarium/drop.sql")
.addScript("/schemas/sepulkarium/create.sql")
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = SepulkaDaoBeans.class)
@Sql("/schemas/alfa/truncate.sql")
@Sql("/schemas/sepulkarium/truncate.sql")
abstract class SepulkaDaoIT {

@Autowired
Expand Down
2 changes: 1 addition & 1 deletion docs/pipeline.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Решение (solution) - система, реализуемая для клиентов. Конвейер (pipeline) - система, реализуемая для разработчиков.

Единый интерфейс для локальной разработки и непрерывной интеграции::
Семантика интерфейса подразумевает набор предопределенных абстракций, артефакты которых последовательно конструируются в ходе сборки. Перед началом конструирования выполняются обязательные проверки. Примеры абстракций: исходники (sources), бинарники (binaries), образы (images), стеки (stacks) и другие.
Семантика интерфейса подразумевает набор предопределенных абстракций, артефакты которых последовательно конструируются в ходе сборки. Перед началом конструирования выполняются обязательные проверки. Примеры абстракций: кодовая база (codebase), бинарники (binaries), образы (images), стеки (stacks) и другие.

Контентная адресация (aka идентификация по содержимому)::
Контентная адресация (content addressability) делает конструирование *идемпотентным*. Для директорий с исходным кодом вычисляются их контентные идентификаторы (CID's). Затем вычисляются корневые идентификаторы решения и конвейера. Таким образом формируется 2 небольших дерева Меркла, хеши которых подставляются в качестве тегов/классификаторов артефактов соответствующих абстракций. Артефакт конструируется, только когда его контентный идентификатор меняется.
Expand Down
2 changes: 1 addition & 1 deletion libs/signatures/pom.xml → libs/abstraction/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<version>${revision}</version>
</parent>

<artifactId>signatures</artifactId>
<artifactId>abstraction</artifactId>

<properties>
<isPrivate>false</isPrivate>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package smecalculus.bezmen.messaging.client;

public interface BezmenClient extends SepulingClient {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package smecalculus.bezmen.messaging.client;

interface FooClient extends SepulkaClient {
interface SepulingClient extends SepulkaClient {
boolean isReady();
}
11 changes: 5 additions & 6 deletions libs/essentials/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<!--CORE-->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>signatures</artifactId>
<artifactId>abstraction</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand All @@ -42,11 +42,6 @@
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<optional>true</optional>
</dependency>
<!--LOGGING-->
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -66,6 +61,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions libs/messaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--TESTING-->
Expand Down
6 changes: 3 additions & 3 deletions libs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<version>${revision}</version>

<modules>
<module>signatures</module>
<module>abstraction</module>
<module>essentials</module>
<module>messaging</module>
<module>storage</module>
Expand Down Expand Up @@ -59,12 +59,12 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>signatures</artifactId>
<artifactId>abstraction</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>signatures</artifactId>
<artifactId>abstraction</artifactId>
<version>${project.version}</version>
<classifier>client</classifier>
</dependency>
Expand Down

This file was deleted.

8 changes: 2 additions & 6 deletions libs/testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>signatures</artifactId>
<artifactId>abstraction</artifactId>
<classifier>client</classifier>
</dependency>

Expand Down Expand Up @@ -49,10 +49,6 @@
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -86,7 +82,7 @@
<directory>${project.basedir}/../../schemas/h2</directory>
<targetPath>schemas</targetPath>
<includes>
<include>alfa/**</include>
<include>sepulkarium/**</include>
</includes>
</resource>
</resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.setType(H2)
.setName("testdb;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;CASE_INSENSITIVE_IDENTIFIERS=true")
.addScript("schemas/alfa/wipe.sql")
.addScript("schemas/alfa/schema.sql")
.addScript("schemas/sepulkarium/wipe.sql")
.addScript("schemas/sepulkarium/schema.sql")
.build();
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions solutions/basis/compose.yml → solutions/usages/basis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
image.name: ${SCHEMA_IMAGE}
command: >
--show-banner=false
--changelog-file=alfa/dba/changelog.yml
--changelog-file=sepulkarium/dba/changelog.yml
--url=jdbc:postgresql://db:5432/bezmen?currentSchema=public
--liquibase-schema-name=public
--username=postgres
Expand All @@ -69,7 +69,7 @@ services:
image.name: ${SCHEMA_IMAGE}
command: >
--show-banner=false
--changelog-file=alfa/owner/changelog.yml
--changelog-file=sepulkarium/owner/changelog.yml
--url=jdbc:postgresql://db:5432/bezmen?currentSchema=bezmen
--liquibase-schema-name=bezmen
--username=bezmen
Expand All @@ -78,9 +78,9 @@ services:
networks:
bezmen: null

foo:
image: ${FOO_IMAGE}:${FOO_TAG}
container_name: app-foo
sepuling:
image: ${SEPULING_IMAGE}:${SEPULING_TAG}
container_name: sepuling
ports:
- 8080:8080
configs:
Expand All @@ -93,6 +93,6 @@ services:
schema-owner:
condition: service_completed_successfully
labels:
image.name: ${FOO_IMAGE}
image.name: ${SEPULING_IMAGE}
networks:
bezmen: null
File renamed without changes.
File renamed without changes.

0 comments on commit a92277a

Please sign in to comment.