Skip to content

Migrating existing jobs to spaces enabled Concourse #1897

Closed

Description

@mhuangpivotal

Epic: #1707

Background

With #1765, we want the scheduler to operate on job combinations. After this change, the scheduler will no longer work with existing jobs. This is not ideal since we would like the change to be backward compatible and users be able to choose not to use spaces. We should have a migration that generates a default combination for every existing job.

Challenges

Job combinations are identified by a hash made up of their resource spaces, and to generate this hash we use a go library called hashstructure. Our current migration scheme only supports raw SQL and does not allow us to use hashstructure to generate the hashes.

Solutions

  • Support Go migrations
    - Use md5 for job combination hashes and write SQL to generate them

Activity

  1. mhuangpivotal commented on Jan 9, 2018

    @mhuangpivotal
    ContributorAuthor

    We looked into a few different approaches:

    • Write a SQL query that generates all job combinations
      Challenges: decoding job config in SQL does not seem possible; no easy way to recursively find all resources in a config
    • Write Go migrations
      Challenges: mattes/migrate only supports SQL migrations. We'd need to roll our own migration or patch mattes/migrate

    We ended up migrating existing jobs to job combinations with combination set to null, and updated scheduler to populate combination with appropriate values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions