Skip to content

Commit 460667e

Browse files
authored
feat(interactive): Update document and build latest Interactive image. (#4501)
- Let `gsctl` use the latest interactive image. - Allow overriding configuration in config via command line argument: `--set a=b`
1 parent 82fbcdc commit 460667e

File tree

16 files changed

+128
-19
lines changed

16 files changed

+128
-19
lines changed

.github/workflows/flex-interactive.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ jobs:
7070
docker image inspect graphscope/interactive:latest --format='{{.Size}}'
7171
# launch service: ${COORDINATOR_PORT} for coordinator http port; ${CYPHER_PORT} for cypher port;
7272
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --cypher-port ${CYPHER_PORT} \
73-
--coordinator-port ${COORDINATOR_PORT} --config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml
73+
--coordinator-port ${COORDINATOR_PORT} --config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml \
74+
--set storage.string_default_max_length=1024
7475
sleep 20
7576
# test
7677
python3 -m pip install --no-cache-dir pytest pytest-cov pytest-timeout pytest-xdist

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,61 @@ jobs:
158158
sudo docker tag graphscope/interactive:${SHORT_SHA} ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}-arm64
159159
sudo docker push ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}-arm64
160160
161+
push-interactive-image-manifest:
162+
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
163+
runs-on: ubuntu-22.04
164+
165+
needs: [build-interactive-image-amd64, build-interactive-image-arm64]
166+
167+
- name: Add envs to GITHUB_ENV
168+
run: |
169+
short_sha=$(git rev-parse --short HEAD)
170+
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
171+
172+
- name: Create and Push Docker Manifest
173+
env:
174+
docker_password: ${{ secrets.DOCKER_PASSWORD }}
175+
docker_username: ${{ secrets.DOCKER_USER }}
176+
run: |
177+
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
178+
179+
# create
180+
sudo docker manifest create \
181+
${{ env.INTERACTIVE_IMAGE }}:${SHORT_SHA} \
182+
${{ env.INTERACTIVE_IMAGE }}:${SHORT_SHA}-amd64 \
183+
${{ env.INTERACTIVE_IMAGE }}:${SHORT_SHA}-arm64
184+
185+
# push
186+
sudo docker manifest push ${{ env.INTERACTIVE_IMAGE }}:${SHORT_SHA}
187+
188+
# Remove old latest manifest
189+
sudo docker manifest rm ${{ env.INTERACTIVE_IMAGE }}:latest
190+
sudo docker manifest create \
191+
${{ env.INTERACTIVE_IMAGE }}:latest \
192+
${{ env.INTERACTIVE_IMAGE }}:latest-amd64 \
193+
${{ env.INTERACTIVE_IMAGE }}:latest-arm64
194+
195+
sudo docker manifest push ${{ env.INTERACTIVE_IMAGE }}:latest
196+
197+
- name: Extract Tag Name
198+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
199+
id: tag
200+
run: echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
201+
202+
- name: Release Image
203+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope' }}
204+
env:
205+
docker_password: ${{ secrets.DOCKER_PASSWORD }}
206+
docker_username: ${{ secrets.DOCKER_USER }}
207+
run: |
208+
echo "${docker_password}" | sudo docker login --username="${docker_username}" ${{ env.DOCKER_URL }} --password-stdin
209+
sudo docker manifest create \
210+
${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }} \
211+
${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}-amd64 \
212+
${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}-arm64
213+
214+
sudo docker manifest push ${{ env.INTERACTIVE_IMAGE }}:${{ steps.tag.outputs.TAG }}
215+
161216
build-gss-image-amd64:
162217
if: (github.ref == 'refs/heads/main' && github.repository == 'alibaba/GraphScope') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/GraphScope')
163218
runs-on: ubuntu-20.04

docs/flex/interactive/configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Below is a list of all configurable items:
1616
| storedproc-port | 10000 | The port of the interactive stored procedure service | v0.3 |
1717
| cypher-port | 7687 | The port of the cypher service | v0.3 |
1818
| config | None | The customized configuration file for engine interactive service | v0.4 |
19+
| image-tag | latest | The version of the interactive you want to install | v0.5 |
20+
| set | None | Specify additional properties for Interactive via the command line to override any corresponding settings in the configuration file if they are present | v0.5 |
1921
<!-- | gremlin-port | None | The port of the gremlin service | v0.3 | -->
2022

2123

@@ -121,6 +123,7 @@ In this following table, we use the `.` notation to represent the hierarchy with
121123
| compiler.query_timeout | 3000000 | The maximum time for compiler to wait engine's reply, in `ms` | 0.0.3 |
122124
| http_service.sharding_mode | exclusive | The sharding mode for http service, In exclusive mode, one shard is reserved exclusively for service admin request. In cooperative, both query request and admin request could be served by any shard. | 0.5 |
123125
| http_service.max_content_length | 1GB | The maximum length of a http request that admin http service could handle | 0.5 |
126+
| storage.string_default_max_length | 256 | The default maximum size for a string field | 0.5 |
124127

125128
#### TODOs
126129

docs/flex/interactive/installation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ gsctl instance deploy --type interactive
2525
In addition to the interactive server, a coordinator server is also deployed. The coordinator server functions similarly to the `ApiServer` for k8s, enabling users to engage with the GraphScope platform via a streamlined and standardized set of APIs.
2626
```
2727

28+
```{note}
29+
By default, the latest version of Interactive is used. To specify a fixed version, use the --image-tag option. For example `gsctl instance deploy --type interactive --image-tag v0.31.0`.
30+
```
31+
2832
<!-- 2. Gremlin service is disabled by default, To enable it, try specifying the Gremlin port, see [Service-Accessibility](./installation.md#service-accessibility) -->
2933

3034

flex/storages/rt_mutable_graph/loader/abstract_arrow_fragment_loader.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ void AbstractArrowFragmentLoader::AddEdgesRecordBatch(
395395
property_types[0].type_enum ==
396396
impl::PropertyTypeImpl::kStringView) {
397397
// Both varchar and string are treated as string. For String, we use the
398-
// default max length defined in PropertyType::STRING_DEFAULT_MAX_LENGTH
399-
uint16_t max_length = PropertyType::STRING_DEFAULT_MAX_LENGTH;
398+
// default max length defined in PropertyType::GetStringDefaultMaxLength()
399+
uint16_t max_length = PropertyType::GetStringDefaultMaxLength();
400400
if (property_types[0].type_enum == impl::PropertyTypeImpl::kVarChar) {
401401
max_length = property_types[0].additional_type_info.max_length;
402402
}

flex/storages/rt_mutable_graph/loader/basic_fragment_loader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class BasicFragmentLoader {
122122
const auto& prop = schema_.get_edge_properties(src_label_id, dst_label_id,
123123
edge_label_id);
124124

125-
size_t max_length = PropertyType::STRING_DEFAULT_MAX_LENGTH;
125+
size_t max_length = PropertyType::GetStringDefaultMaxLength();
126126
if (prop[0].IsVarchar()) {
127127
max_length = prop[0].additional_type_info.max_length;
128128
}

flex/storages/rt_mutable_graph/mutable_property_fragment.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ inline DualCsrBase* create_csr(EdgeStrategy oes, EdgeStrategy ies,
104104
ie_mutable);
105105
} else if (properties[0] == PropertyType::kStringView) {
106106
return new DualCsr<std::string_view>(
107-
oes, ies, gs::PropertyType::STRING_DEFAULT_MAX_LENGTH, oe_mutable,
107+
oes, ies, gs::PropertyType::GetStringDefaultMaxLength(), oe_mutable,
108108
ie_mutable);
109109
}
110110
} else {

flex/storages/rt_mutable_graph/schema.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class Schema {
4646
static constexpr const char* PRIMITIVE_TYPE_KEY = "primitive_type";
4747
static constexpr const char* VARCHAR_KEY = "varchar";
4848
static constexpr const char* MAX_LENGTH_KEY = "max_length";
49-
static constexpr const uint16_t STRING_DEFAULT_MAX_LENGTH = 256;
5049

5150
// The builtin plugins are reserved for the system.
5251
static constexpr uint8_t BUILTIN_PLUGIN_NUM = 4;

flex/utils/id_indexer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ class LFIndexer {
242242
} else if (type.type_enum == impl::PropertyTypeImpl::kStringView) {
243243
LOG(WARNING) << "String type is a deprecated type, use varchar instead.";
244244
LOG(WARNING) << "Use default max length"
245-
<< PropertyType::STRING_DEFAULT_MAX_LENGTH
245+
<< PropertyType::GetStringDefaultMaxLength()
246246
<< " for varchar type.";
247247
keys_ = new StringColumn(StorageStrategy::kMem,
248-
PropertyType::STRING_DEFAULT_MAX_LENGTH);
248+
PropertyType::GetStringDefaultMaxLength());
249249
} else {
250250
LOG(FATAL) << "Not support type [" << type << "] as pk type ..";
251251
}

flex/utils/property/column.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ template <>
9191
class TypedEmptyColumn<std::string_view> : public ColumnBase {
9292
public:
9393
TypedEmptyColumn(
94-
int32_t max_length = PropertyType::STRING_DEFAULT_MAX_LENGTH) {}
94+
int32_t max_length = PropertyType::GetStringDefaultMaxLength()) {}
9595
~TypedEmptyColumn() {}
9696

9797
void open(const std::string& name, const std::string& snapshot_dir,
@@ -164,7 +164,7 @@ std::shared_ptr<ColumnBase> CreateColumn(
164164
return std::make_shared<StringEmptyColumn>();
165165
} else if (type == PropertyType::kStringView) {
166166
return std::make_shared<StringEmptyColumn>(
167-
gs::PropertyType::STRING_DEFAULT_MAX_LENGTH);
167+
gs::PropertyType::GetStringDefaultMaxLength());
168168
} else if (type.type_enum == impl::PropertyTypeImpl::kVarChar) {
169169
return std::make_shared<StringEmptyColumn>(
170170
type.additional_type_info.max_length);

0 commit comments

Comments
 (0)