Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ jobs:
include:
- testsuite: api:routes
runner: run_server_tests.bash
env:
MANAGEMENT_BACKEND: operator
- testsuite: api:retry
runner: run_server_tests.bash
- testsuite: replication
Expand Down
2 changes: 0 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ is derived for them, and their value is not validated.
passed by the deployment rather than configured in the file.
- `S3AUTH_CONFIG`: path of the account credentials file, for the `account` auth
type.
- `MANAGEMENT_BACKEND`, `REMOTE_MANAGEMENT_DISABLE`: management backend of the
Zenko deployment, and whether to run it.
- `LIFECYCLE_OBJECT_PROCESSOR_TYPE`: the lifecycle object tasks this processor
consumes, `expiration` (the default) or `transition`.
- `LIFECYCLE_MAX_AUTO_INDEX_DOC_COUNT`,
Expand Down
6 changes: 3 additions & 3 deletions docs/run-oob-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ Add Ring access key and secret key in conf/locationConfig.json:
Start backbeat API:

```
MANAGEMENT_BACKEND=operator REMOTE_MANAGEMENT_DISABLE=true yarn start
REMOTE_MANAGEMENT_DISABLE=true yarn start

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the deleted pensieveBackend.js read REMOTE_MANAGEMENT_DISABLE, so it does nothing in Backbeat now (you also took it out of docs/configuration.md). Drop it here too. Other places still set it for Backbeat: README.md, docs/run-transition-locally.md, docs/run-crr-replay-locally.md and .github/dockerfiles/ft/docker-compose.yaml.

Suggested change
REMOTE_MANAGEMENT_DISABLE=true yarn start
yarn start

```

## Backbeat - Ingestion producer

```
MANAGEMENT_BACKEND=operator yarn ingestion_populator
yarn ingestion_populator
```

## Backbeat - Ingestion processor

```
MANAGEMENT_BACKEND=operator yarn mongo_queue_processor
yarn mongo_queue_processor
```

## VaultClient
Expand Down
32 changes: 0 additions & 32 deletions lib/management/convertServiceStateFormat.js

This file was deleted.

29 changes: 3 additions & 26 deletions lib/management/index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
const config = require('../Config');
const werelogs = require('werelogs');

werelogs.configure({
level: config.log.logLevel,
dump: config.log.dumpLevel,
});

const logger = new werelogs.Logger('management:facade');

function loadManagementBackend() {
const backendName = process.env.MANAGEMENT_BACKEND;
const backend = backendName === 'operator' ?
'operatorBackend' : 'pensieveBackend';

const mod = require(`./${backend}`);

if (!mod) {
logger.error('management backend not found', { backendName });
process.exit(1);
}

return mod;
}

module.exports = loadManagementBackend();
// The operator (zenko-operator) backend is the only management backend:
// MANAGEMENT_BACKEND is still set by deployments but no longer selects anything.
module.exports = require('./operatorBackend');
62 changes: 0 additions & 62 deletions lib/management/patchConfiguration.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
'use strict';

const async = require('async');
const config = require('../Config');
const bucketclient = require('@scality/bucketclient');
const { patchLocations } = require('@scality/arsenal').patches.locationConstraints;
const Metadata = require('@scality/arsenal').storage.metadata.MetadataWrapper;
const managementDatabaseName = 'PENSIEVE';
const tokenConfigurationKey = 'auth/zenko/remote-management-token';
const refreshInterval = 5000;
let patchedLocations = {};

function updateIngestionBuckets(locations, metadata, logger, cb) {
metadata.getIngestionBuckets(logger, (err, buckets) => {
Expand All @@ -24,61 +19,6 @@ function updateIngestionBuckets(locations, metadata, logger, cb) {
});
}

function updateLocations(locations) {
const locationsWithReplicationBackend = Object.keys(locations)
// NOTE: In Orbit, we don't need to have Scality location in our
// destination bootstrapList config, since we do not replicate to
// any Scality Instance yet.
.filter(key => locations[key].locationType !== 'location-file-v1')
.reduce((obj, key) => {
/* eslint no-param-reassign:0 */
obj[key] = locations[key];
return obj;
}, {});
config.setBootstrapList(locationsWithReplicationBackend);

Object.keys(locations).forEach(locName => {
config.setIsTransientLocation(
locName, locations[locName].isTransient);
});
}

function patchConfiguration(
overlayVersion, patchConfig, metadata, ingestionEnabled, logger, cb
) {
if (patchConfig === undefined ||
patchConfig.version === undefined ||
patchConfig.locations === undefined
) {
return process.nextTick(cb, null);
}

const conf = Object.assign({}, patchConfig);
return async.waterfall([
next => metadata.getObjectMD(
managementDatabaseName,
tokenConfigurationKey,
{},
logger,
next,
),
(creds, next) => {
// only update locations on new overlay version
if (overlayVersion === undefined || conf.version > overlayVersion) {
patchedLocations = patchLocations(conf.locations, creds, logger);
config.setPublicInstanceId(conf.instanceId);
updateLocations(patchedLocations);
}

// only update ingestion buckets list when ingestionEnabled
if (ingestionEnabled) {
return updateIngestionBuckets(patchedLocations, metadata, logger, next);
}
return process.nextTick(next);
},
], cb);
}

function buildMetadataParams(c) {
const groupId = c.extensions.replication.replicationStatusProcessor.groupId;
const mongo = c.queuePopulator.mongo;
Expand Down Expand Up @@ -148,8 +88,6 @@ function periodicallyUpdateIngestionBuckets(locations, logger, cb) {
}

module.exports = {
patchConfiguration,
updateLocations,
updateIngestionBuckets,
buildMetadataParams,
periodicallyUpdateIngestionBuckets,
Expand Down
196 changes: 0 additions & 196 deletions lib/management/pensieveBackend.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/management/serviceState.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const getWorkflowUpdates = require('./getWorkflowUpdates');
const logger = new werelogs.Logger('mdManagementServiceState');

const notImplementedErr = errors.NotImplemented.customizeDescription(
`not implemented for management backend '${process.env.MANAGEMENT_BACKEND}'`);
'not implemented by the service state backend');

function getServiceWorkflows(serviceName) {
const workflows = [serviceName];
Expand Down
Loading
Loading